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

[BUG] Multi-Part content type in response ignores properties of composed schema (allOf/oneOf) #6073

Merged
merged 2 commits into from
Aug 1, 2020

Conversation

vvalchev
Copy link
Contributor

@vvalchev vvalchev commented Apr 27, 2020

Fixed issue #6070 - [BUG][All Languages] Multi-Part content type in respons…e ignores properties of composed schema (allOf/oneOf)

#6070

This change uses the existing addProperties() method to combine properties of composed schemas.

Before the change, the generated file looked like:
https://gist.github.com/vvalchev/54a935c0f93c06a184a9eeb1640f96e6#file-usersapi-java

After the change, the fist method is properly generated and includes all inherited properties:
https://gist.github.com/vvalchev/54a935c0f93c06a184a9eeb1640f96e6#file-usersapi-java-fixed

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.

CC: @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)

fixes #6070

…e ignores properties of composed schema (allOf/oneOf)

#6070

This change uses the existing addProperties() method to combine properties of composed schemas.
@wing328
Copy link
Member

wing328 commented May 2, 2020

cc @OpenAPITools/generator-core-team

@vvalchev
Copy link
Contributor Author

3 months, 2 days passed

@jimschubert jimschubert changed the title Fixed issue #6070 [BUG] Multi-Part content type in response ignores properties of composed schema (allOf/oneOf) Aug 1, 2020
@jimschubert
Copy link
Member

@vvalchev thanks for bumping this, and thanks for providing the level of detail for repro and the fix.

Your PR was likely not picked up quickly because of the original title ("Fixed issue #6070"), and because your changes were to DefaultCodegen but tagged the Java technical committee.

I can't speak for others, only for myself, but I'm much quicker to pick up pull requests with clear titles and/or labels because nondescript titles often don't contain the level of details you've provided in the PR description. I'll propose a change to our contributing documentation and issues/pull templates to clarify the importance of the titles and repro steps.

I pulled this and merged master up to the branch, then tested this locally with the following config file:

generatorName: jaxrs-spec
apiPackage: com.mycompany.api
modelPackage: com.mycompany.dto
additionalProperties:
  dateLibrary: java8
  java8: 'true'
  useBeanValidation: 'true'
  performBeanValidation: 'true'
  useTags: 'true'
  interfaceOnly: 'true'
  skipDefaultInterface: 'true'

And CLI args:

generate -g jaxrs-spec -i .bak/6073/spec.yaml -c .bak/6073/config.yaml -o .bak/6073/out

Everything looks good. Thanks for the excellent contribution!

@jimschubert jimschubert merged commit 5b22d08 into OpenAPITools:master Aug 1, 2020
@jimschubert jimschubert added this to the 5.0.0 milestone Aug 1, 2020
jimschubert added a commit that referenced this pull request Aug 3, 2020
* master: (121 commits)
  [PowerShell] better publishing workflow (#7114)
  [aspnetcore] Typo issues in docs and generated code (#7094)
  fix http signaure auth in build.sbt (#7110)
  fix for the issue facing spec invlolving arrayschema structure with ref (#6310)
  [csharp-netcore] added cancellation tokens to async calls (#7077)
  [PS] Allow CI to publish the module (#7091)
  [Dart] Treat float as double (#6924)
  [Java][jersey2]Fix gradle HttpSignatureAuth dependencies (#7096)
  move maven,gradle tests to shipppable ci (#7108)
  [MARKDOWN] Fix issue 6089 with property and parameter names (#6105)
  [BUG] Multi-Part content type in response ignores properties of composed schema (allOf/oneOf) (#6073)
  [online] Fix for version conflicts with springfox/boot (#7102)
  skip some installations to shorten build time
  [Go][Exp] better code format (#7088)
  Fix Shippable CI (#7097)
  typescript-node: clean up require and import (#6947)
  commented out perl, bash tests to reduce build time
  Add a link to conference paper (#7086)
  Add a link to the blog post at qiita (#7084)
  migrate typescript.sh to new config format (#7078)
  ...
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][All Languages] Multi-Part content type in response ignores properties of composed schema (allOf/oneOf)
3 participants