Skip to content
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

[Spring][server] oneOf Interface for Spring Boot #8091

Closed
wants to merge 27 commits into from

Conversation

jburgess
Copy link
Contributor

@jburgess jburgess commented Dec 3, 2020

This implements OneOf interfaces for the Java Spring library. Merges #5661 (@alexsuperdev) and #6589 (@rfecher) and refreshes against the main branch.

Fixes #5381 and #15 (for Spring)

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • If contributing template-only or documentation-only changes which will change sample output, build the project beforehand.
  • Run the shell script ./bin/generate-samples.shto update all Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master. These must match the expectations made by your contribution. You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*. For Windows users, please run the script in Git BASH.
  • File the PR against the correct branch: master
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.

@bbdouglas @sreeshas @jfiala @lukoyanov @cbornet @jeff9finger @karismann @Zomzog @lwlee2608 @bkabrda

alexsuperdev and others added 22 commits March 22, 2020 11:15
added x-is-one-of-interface extension for oneOf interface in mustache
template
fixed name of model from UNKNOWN_BASE_TYPE to right one in api: operationId + OneOf

Fix OpenAPITools#5381
parcelableModel is not required
removed not needed methods
catch NPE cases in preprocessOpenAPI
updated samples
fixed generation of oneOf Models
addOneOfInterfaceModel only for cases when useOneOfInterfaces is true and for spring
…rator into spring_fix_5381

� Conflicts:
�	modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java
spring: fixed use of oneOf Models in API
implementing oneOf for spring lib overriding methods with different behavior from default
added x-is-one-of-interface extension for oneOf interface in mustache
template
fixed name of model from UNKNOWN_BASE_TYPE to right one in api: operationId + OneOf

Fix OpenAPITools#5381
removed not needed methods

Fix OpenAPITools#5381
fixed generation of oneOf Models

Fix OpenAPITools#5381
addOneOfInterfaceModel only for cases when useOneOfInterfaces is true and for spring

Fix OpenAPITools#5381
NPE fix for tests
fixed handing of composed schema with array
fixed NPE in addOneOfInterfaceModel
fixed generation of oneOf models with descriminator
# Conflicts:
#	modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java
@wing328
Copy link
Member

wing328 commented Dec 4, 2020

cc @OpenAPITools/generator-core-team as the change impacts default codegen.

@jburgess
Copy link
Contributor Author

jburgess commented Dec 4, 2020

@wing328 can I get you to re-run the CI? Looks like a transient dependency download error.

# Conflicts:
#	modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java
@guluevruslan
Copy link

@wing328, hi.
Could these changes be included into the patch for version 4.3.1?

@wing328 wing328 modified the milestones: 5.0.0, 5.0.1 Dec 21, 2020
@wing328 wing328 modified the milestones: 5.0.1, 5.1.0 Feb 8, 2021
@wing328 wing328 modified the milestones: 5.1.0, 5.1.1 Mar 19, 2021
@saurcery
Copy link

saurcery commented Apr 9, 2021

hi @jburgess @wing328 any update on this :)
is this slated for any milestone/patch release ?

@rj93
Copy link

rj93 commented Jun 14, 2021

any news on this?

@tim-hilt
Copy link

Also would love to have this functionality!

# Conflicts:
#	modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java
#	modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java
@jburgess
Copy link
Contributor Author

I have resolved the merge conflicts. @wing328 can we get this scheduled for a release?

@tim-hilt
Copy link

@jburgess thanks for your work so far! Really excited for what happens next!

@wing328
Copy link
Member

wing328 commented Aug 25, 2021

@jburgess thanks again for the PR and sorry for the delay in reviewing as there're too many PRs.

Please resolve the merge conflicts and I'll review later this week.

@wing328
Copy link
Member

wing328 commented Sep 14, 2021

FYI. I've resolved the merge conflicts and filed #10392 instead.

@wing328
Copy link
Member

wing328 commented Mar 16, 2022

Closed via #11650

@wing328 wing328 closed this Mar 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] [spring][server] oneOf Polymorphism support for spring boot
7 participants