Open LazarenkoA opened 5 months ago
@LazarenkoA - i believe this is working - try to add this tags to your struct:
type CustomTypes []CustomType
type test struct {
Field1 CustomTypes `json:"field1" jsonschema:"maxItems=10"`
}
it also supports minItems
in the same way
@Rosswell so it adds here "field1": { "$ref": "#/$defs/CustomTypes", "maxItems": 10 }
but it needs to be in the type
I have the following Go structure:
This generates the following JSON schema:
I need to add a maxItems constraint to the CustomTypes array, for example:
How can I achieve this? I can't add a tag to the type definition in Go.