jsonschema

package
v1.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 17, 2026 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package jsonschema contains JSON Schema helpers shared by Genkit provider plugins.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnforceStrict

func EnforceStrict(schema map[string]any) map[string]any

EnforceStrict returns a deep copy of schema with additionalProperties: false set on every object subschema, recursing through "properties" and "items". This is the shape OpenAI and Anthropic require for strict tool schemas.

The input is not mutated. If the schema is not JSON-marshalable, the original map is returned unchanged.

func ReflectConfigSchema added in v1.12.0

func ReflectConfigSchema(config any, overrides map[string]*jsonschema.Schema) map[string]any

ReflectConfigSchema reflects an SDK request-params struct into the JSON schema map a model advertises as its config. The provider SDKs wrap optional primitives in generic Opt types that marshal as bare values but reflect as objects, so those are mapped to their wire shapes; overrides adds SDK-specific mappings by type name (e.g. inline unions) that take precedence.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL