Skip to content

Fix for [BUG] jaxrs-spec [server] oneOf, anyOf Polymorphism does not work #6253

Open
tuxBurner wants to merge 9 commits intoOpenAPITools:masterfrom
micromata:fix/#5565
Open

Fix for [BUG] jaxrs-spec [server] oneOf, anyOf Polymorphism does not work #6253
tuxBurner wants to merge 9 commits intoOpenAPITools:masterfrom
micromata:fix/#5565

Conversation

@tuxBurner
Copy link

For the issue #5565 this is a fix in the current master 5.0.0-SNAPSHOT
With this it is possible to generate onOf interfaces and there related pojos in the jaxrs-spec codegen module

@bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04) @lwlee2608 (2019/10) @bkabrda (2020/01)

PR checklist

  • Read the contribution guidelines.
  • If contributing template-only or documentation-only changes which will change sample output, build the project before.
  • Run the shell script(s) under ./bin/ (or Windows batch scripts under.\bin\windows) to update Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run ./bin/{LANG}-petstore.sh, ./bin/openapi3/{LANG}-petstore.sh if updating the code or mustache templates for a language ({LANG}) (e.g. php, ruby, python, etc).
  • File the PR against the correct branch: master, 4.3.x, 5.0.x. Default: master.
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.

@tuxBurner
Copy link
Author

@jeff9finger Did some changes and merged master

@tuxBurner
Copy link
Author

Okay @jeff9finger all checks are green now :)

Copy link

@jeff9finger jeff9finger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were the changes to this file necessary? Looks like it was only adding a space and empty lines.

Copy link

@jeff9finger jeff9finger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My comments were addressed and this looks good to me. Does anyone else care to review?

Comment on lines +1086 to +1088
List<Object> models = (List<Object>) objs.get("models");
for (Object _mo : models) {
Map<String, Object> mo = (Map<String, Object>) _mo;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you casting twice instead of only once:

Suggested change
List<Object> models = (List<Object>) objs.get("models");
for (Object _mo : models) {
Map<String, Object> mo = (Map<String, Object>) _mo;
List<Map<String, Object>> models = (List<Map<String, Object>>) objs.get("models");
for (Map<String, Object> mo : models) {

@R1tschY
Copy link

R1tschY commented Oct 10, 2020

What is the current state of this? Any updates? I would like to continue the work if no one else does.

@tuxBurner
Copy link
Author

@R1tschY it hast to be updated to the current 5.0.0 branch i use the code already in production and it works but currently it is outdated.

@antonavery-oviva
Copy link

@tuxBurner any plans to still land this in?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants