-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
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
Schema annotation updates #601
Conversation
ce3ad94
to
d8b3f62
Compare
d8b3f62
to
dc7eb28
Compare
Test new parameters on the Schema annotation which don't involve subschemas. - comment - const - dependentRequired - contentEncoding - contentMediaType
dc7eb28
to
cd35c07
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks @Azquelt
@@ -40,10 +54,7 @@ | |||
public @interface Schema { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are your thoughts on having a String value() default ""
property that could be used to set an arbitrary schema (that must be valid JSON/YAML)? That would give support for alternate dialects with the annotation.
I'm not sure myself, but I wanted to mention it as a possibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's certainly an interesting option which I hadn't considered. It becomes a bit more usable since Java 15 added text blocks too.
I'll raise a new issue to think about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened #610 to continue the discussion after this is merged.
Add new fields to
@Schema
and@SchemaProperty
to support the new properties available in OpenAPI 3.1.Builds on the model changes from #598
New properties:
examples
comment
constValue
ifSchema
/thenSchema
/elseSchema
dependentSchemas
contains
/maxContains
/minContains
prefixItems
patternProperties
dependentRequired
propertyNames
contentEncoding
/contentMediaType
/contentSchema
Additional changes:
example
in preference of usingexamples
example
to preserve backward compatibilityTrue
andFalse
valid everywhere thatClass
is accepted to indicate a subschemaadditionalProperties
additionalProperties
to@SchemaProperty
additionalProperties
in@SchemaProperty
, then we may want to reconsider adding all the other new properties there also@Schema
javadocOther notes:
type
andnullable
are unchanged to preserve backward compatibility