Closed AdamJSoftware closed 2 years ago
I've tried using the validate tag but it seems to do nothing for some reason
openapi-go
uses github.com/swaggest/jsonschema-go
to reflect JSON schema, please check https://github.com/swaggest/jsonschema-go#field-tags for more details on supported field tags.
In your case you need to add required:"true"
to the required field.
type MyStruct struct {
Foo int `json:"foo" required:"true"`
}
Yep that fixes my problems! Was looking at the wrong jsonschema go project!
I can see that path automatically gets the required property, but what about other fields? Is there any required/not_nullable tag that can be used?
I tried looking through the documentation but I don't really see anything that can help me with this.