We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am generating the schema for an image like that https://github.com/RedHatInsights/edge-api/blob/main/cmd/spec/main.go#L33
In some cases, this Commit and Installer attributes are expanded but in other cases they are not. Is there a way to annotate a field (in this case, https://github.com/RedHatInsights/edge-api/blob/main/pkg/models/images.go#L32, for example) to add a nullable: true property?
The text was updated successfully, but these errors were encountered:
Hi @biancarosa! One way to add nullable true is simply to set the Schema struct field. For instance with your Commit example (untested code):
// ... gen.addSchema("v1.Image", &models.Image{}) gen.Components.Schemas["v1.Image"].Value.Properties["Commit"].Value.Nullable = true // ...
You can also annotate a field by defining a customizer. See https://pkg.go.dev/github.com/getkin/kin-openapi@v0.90.0/openapi3gen#example-SchemaCustomizer
Sorry, something went wrong.
Duplicates #968
No branches or pull requests
I am generating the schema for an image like that https://github.com/RedHatInsights/edge-api/blob/main/cmd/spec/main.go#L33
In some cases, this Commit and Installer attributes are expanded but in other cases they are not. Is there a way to annotate a field (in this case, https://github.com/RedHatInsights/edge-api/blob/main/pkg/models/images.go#L32, for example) to add a nullable: true property?
The text was updated successfully, but these errors were encountered: