diff --git a/libs/jsonschema/from_type.go b/libs/jsonschema/from_type.go index a54256bf5..21fdb2106 100644 --- a/libs/jsonschema/from_type.go +++ b/libs/jsonschema/from_type.go @@ -45,7 +45,7 @@ type constructor struct { // For example: // {"a/b/c": "value"} is converted to {"a": {"b": {"c": "value"}}} // the $ref for "value" would be "#/$defs/a/b/c" in the generated JSON schema. -func (c *constructor) Definitions() any { +func (c *constructor) Definitions() map[string]any { defs := maps.Clone(c.definitions) // Remove the root type from the definitions. We don't need to include it in diff --git a/libs/jsonschema/schema.go b/libs/jsonschema/schema.go index 10e646165..7690ec2f7 100644 --- a/libs/jsonschema/schema.go +++ b/libs/jsonschema/schema.go @@ -15,7 +15,7 @@ import ( type Schema struct { // Definitions that can be reused and referenced throughout the schema. The // syntax for a reference is $ref: #/$defs/ - Definitions any `json:"$defs,omitempty"` + Definitions map[string]any `json:"$defs,omitempty"` // Type of the object Type Type `json:"type,omitempty"`