-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Fixing polymorphism issues #2037
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
base: 1.5
Are you sure you want to change the base?
Conversation
- Fixed: swagger-api#1737
…ew metadata (cherry picked from commit e4d540b)
…into 'master' of https://github.com/sapienstech/swagger-core # Conflicts: # modules/swagger-annotations/pom.xml # modules/swagger-core/pom.xml # modules/swagger-core/src/test/resources/Cat.json # modules/swagger-hibernate-validations/pom.xml # modules/swagger-jaxrs/pom.xml # modules/swagger-jersey-jaxrs/pom.xml # modules/swagger-jersey2-jaxrs/pom.xml # modules/swagger-models/pom.xml # modules/swagger-mule/pom.xml # modules/swagger-servlet/pom.xml # pom.xml
# Conflicts: # modules/swagger-core/src/main/java/io/swagger/jackson/ModelResolver.java
|
Any news on this issue? |
|
@morpheus9999 still waiting for someone to review my work.. it's now been more than 6 months... |
|
@roni-frantchi Will your changes cover the case where there are multiple abstract subtypes in the inheritance hierarchy? For example: |
|
@ErikGrimes Yes they do. interface I {...};
@ApiModel(parent = I.class)
abstract class A implements I {...};
@ApiModel(parent = A.class)
class B extends A {...}; |
|
|
I expect swagger-core to mirror Jackson's behavior, where you list the concrete subtypes using I haven't really found a description of how So, I'm trying to understand: Will this patch fix the problems with using intermediate subtypes defined using the How is the
Will this patch generate definitions for subtypes as expected when the information is contained in the Jackson annotations instead of in ApiModel annotations? |
|
@ErikGrimes Say your project has You cannot use the
|
We have the same problem, |
|
@francesco995 |
|
@roni-frantchi I haven't really looked at this in awhile, but now I'm using a code a schema first approach with the OpenAPI generator tool. I've forked the tool to improve inheritance support. Hopefully, I'll be able to get it into a pull request and have it merged back upstream. So, I've bypassed the problem more that solved it. |
@ApiModel(parent = Pet.class)seems to have no affect whensubTypesisn't set #1737...And applied changes based on @fehguy feedback here: #1741 (comment)
Now, the
parentattribute is no longer part of the generated JSON (or model for that matter), so it is now valid in accordance to the spec.