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

[codegen] Fix 'super.HashCode' for oneOf and allOf Implementations #5824

Closed
wants to merge 9 commits into from

Conversation

jburgess
Copy link
Contributor

@jburgess jburgess commented Apr 4, 2020

This fixes various client and server generators which use allOf and discriminator patterns as identified in #5587

This error occurs as the hasVars boolean is not set for models which contain extension patterns. This fix simply sets the boolean at the end of code generation bases on the existence of variables after post-processing these special object types.

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.

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

@jburgess
Copy link
Contributor Author

jburgess commented Apr 5, 2020

@wing328 I am hoping you can provide a recommendation. This PR consists of a one line change to the DefaultCodegen.java. I ran the run_all_petstore from the PR checklist and this added a slew of changes to this PR. These all appear to be related to the version bump from 4.3.0-SNAPSHOT to 4.3.1-SNAPSHOT. I would have expected these changes to already be present. Can you provide a recommendation to slim down this PR to only the relevant changes? Thanks in advance!

wing328 and others added 2 commits April 6, 2020 00:12
* update swagger parser to 2.0.18

* fix online server exception

* Revert "fix online server exception"

This reverts commit fe3cb52.

* update parser to 2.0.19
When generating model that use allOf, the equals and hashCode methods
must take the parent class into account.
@wing328
Copy link
Member

wing328 commented Apr 5, 2020

@jburgess please revert the changes related to run-all-petstore script as it should be run by the CIs only.

Please run ./bin/utils/ensure-up-to-date instead.

@wing328
Copy link
Member

wing328 commented Apr 5, 2020

Looks like you're including commits not authored by you in this PR (due to rebase?)

I would suggest you file a new PR from the latest master instead.

@jburgess
Copy link
Contributor Author

jburgess commented Apr 5, 2020

Thanks @wing328. Opened #5830

@jburgess jburgess closed this Apr 5, 2020
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.

3 participants