Skip to content

[elm] Add support for oneOf #4434

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

Merged
merged 1 commit into from
Nov 17, 2019
Merged

Conversation

eriktim
Copy link
Contributor

@eriktim eriktim commented Nov 10, 2019

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.

The Elm generator already supported discriminators allowing for custom types. This PR adds support using oneOf for this as well (both with and without discriminator). I also added a (reusable) spec file for testing with discriminators, allOf and oneOf.

@auto-labeler
Copy link

auto-labeler bot commented Nov 10, 2019

👍 Thanks for opening this issue!
🏷 I have applied any labels matching special text in your issue.

The team will review the labels and make any necessary changes.

And add additional test for composable types.
@eriktim
Copy link
Contributor Author

eriktim commented Nov 15, 2019

@wing328 What do you think of the new modules/openapi-generator/src/test/resources/3_0/composition.yaml?

@wing328
Copy link
Member

wing328 commented Nov 17, 2019

@eriktim looks good to me. We do have test spec for oneOf/anyOf/allOf under the same directory, e.g. https://github.com/OpenAPITools/openapi-generator/blob/d505523ae7e4771b69b0f344bc87b546b75ef6db/modules/openapi-generator/src/test/resources/3_0/oneOf.yaml

Yours clearly cover more edge cases.

@wing328 wing328 merged commit 3cd0e13 into OpenAPITools:master Nov 17, 2019
@eriktim eriktim deleted the elm-composition branch November 17, 2019 06:46
jimschubert added a commit to jimschubert/openapi-generator that referenced this pull request Nov 17, 2019
…ulti-level-model-hierarchy

* origin/master:
  minor fix to CI failure
  feat(dart-dio): correctly handle Map<String, Object>, List<Object> using JsonObject (OpenAPITools#4401)
  [OCAML] Fixes cloud.drone.io ocaml-test (OpenAPITools#4501)
  [elm] Add support for oneOf (OpenAPITools#4434)
  [BUG] [Java] Client resttemplate and webclient. Form Params are badly added when they are lists  (OpenAPITools#4461)
  fix: prevent ClassCastException when handling options of (issue OpenAPITools#4468) (OpenAPITools#4495)
  Fixes Python client Configuration class so each instance uses its own dicts (OpenAPITools#4485)
@wing328
Copy link
Member

wing328 commented Dec 2, 2019

@eriktim thanks for the PR, which has been included in the v4.2.2 release: https://twitter.com/oas_generator/status/1201432648544972800

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.

2 participants