-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
v3 swagger-core module notes, major todo and open questions #2312
Comments
Point 1
Point 2
Point 3-- yes that makes sense. Point 4
Point 5
Point 6
Point 7--that's just fine Point 8
Point 9
Point 10
Looks good, very complete. Thank you! |
@fehguy thanks, one thing about point 2 (Jackson @jsonsubtypes annotations): you say:
we don't have currently |
Hmm I'm not exactly sure. Arent the subtypes only needed for oneOf or anyOf ? If so I don't think it should be added to '@schrma' |
@fehguy sorry missed your comment, subtypes are needed for any composition, mainly because when resolving starting from a "parent" (a class which is extended and/or used as "parent" in anyOf, allOf, oneOf annotations) we have otherwise no way to know we should resolve "children"; this was true also in 2.0, where either jackson |
updated open questions and todo (includes areas spotted in swagger-jaxrs):open questions
todo core
todo jaxrsA. SpecFilter (includes replacing ReaderListener with filter run before and after) todo allI. bootstrapping |
ref #2312 - enhanced 3.0 serialization, deserialization and resolving
swagger integration and #2312 improvements and fixes
ref #2312 - requiredProperties and `not` support
First Release candidate's release notes draft, summarizing remaining TODOs of the list in comments above: Release notesswagger-core v2.0.0-rc0 Release candidate!The Swagger team is proud to announce the rc0 release candidate of our main java library swagger-core. This release candidate provides official initial support for OpenApi 3.0’s main features. The missing features will be added in the next release candidates until the final release is available. In order to better improve these libraries and tools, we ask that you start using them and provide us with feedback in form of issues (please use label Be aware that the release notes contain the notable changes, but there may some changes that we missed in the list. The same applies for the Notable Features:
Limitations
|
closing as implemented or replaced by other tickets |
branch for current effort: https://github.com/frantuma/swagger-core/tree/compound-models-tests-restructure
notable things related questions, and todo (point 10):
swagger-annotations
(see updatedSchema
annotation, and new annotationDiscriminatorMapping
)As an example if we define a "parent" bean like:
and a "child":
when we resolve with a code like:
then both
BaseBean
andSub1Bean
are resolvedif a
@JsonSubTypes
is not declared on the parent, resolver won't be able to "know" about Sub1Bean which will not be resolved.e.g with:
and a "child":
when we resolve with a code like:
then also
BaseBean
will be resolved; this was different in 2.0, where a@JsonSubTypes
was needed on the parent. See temporarily commented code hereA. resolve anyOf, allOf, and oneOf as referenced models
B. resolve anyOf, allOf, and oneOf as inline models (duplicating possibly definitions)
C. resolve anyOf inline, only if referenced type is interface
@Schema (allOf = ..)
annotation is present and/or a@JsonSubTypes
is declared on the parent bean, and other properties are declared in the "child" bean, the result JSON will have anallOf
field holding the parent schema refs, and will declare its own properties in theproperties
field.This is different from 2.0 behaviour, which "merged" also bean "own" properties into allOf array; I guess the former behaviour is possibly more correct, also possibly previous behaviour was related to the way allOf resolving was handled (parent/child "trigger' methods on ComposedModel).
As an example if we define a "parent" bean like:
and a "child":
the serialized JSON/YAML will look like:
@webron @fehguy any thought about this?
position
field (annotations/model/resolver/spec); is it planned, or should we remove refs in tests, etc? any thought about this?swagger-core
module; this includes fix/re-enable/refactor/remove what currently disabled, and reorganizing packagingone note:
AnyOf
withJsonSubTypes
(I guess possibly AnyOf was a leftover..)@fehguy please have a look
reference
of@ApiModel
which seemed to be resolved by replacing the String return type with a ref to the type set as value ofreference
(basically the string value); this is not present in 3.0, not sure what was the original use case; is it ok not to consider and remove related tests?see e.g.
https://github.com/swagger-api/swagger-core/blob/master/modules/swagger-core/src/test/java/io/swagger/models/ModelWithReference.java
https://github.com/swagger-api/swagger-core/blob/master/modules/swagger-core/src/test/java/io/swagger/ModelWithReferenceTest.java
@ApiModel(reference..)
etc)#/definitions
path in tests to#/components/schemas
)The text was updated successfully, but these errors were encountered: