-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Better OpenAPI spec v3 support: allOf, anyOf, oneOf #1360
Conversation
also this one #537? |
@etherealjoy 👍 updated the list |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix {{{#vars}{{{/vars}}}
codegen array, please.
FWIW, I tested with some simple specs using allOf using the python generator. It works really well so far. I ran into the limitation of "allOf"/ComposedSchemas not begin supported, but this is clearly logged. |
@mm-matthias thanks for reviewing the change. Can you ping me via https://gitter.im (ID: wing328) or Google hangout (email address in my Github profile page) for a quick chat? |
Let's go with this PR to start with. If anyone encounters issues related to allOf/anyOf/oneOf, please open an issue with the details. |
+1000 |
I tried the latest build, but it looks like We get warnings like:
|
@tomghyselinck do you mind opening an issue and share the spec so that we can reproduce the issue more easily? |
I would love to give this a try. Is there a binary somewhere that includes this fix? Specifically I want to find out if this addresses the v2 Java multi-level hierarchy bug (not sure it was even reported) where it would not generate the correct Jackson
on A. That's the only reason I'm currently still stuck on Swagger gen 2.4; would love to migrate. |
We push SNAPSHOT releases on sonatype snapshot repository (sort of maven central for snapshots). 3 options:
With gradle/maven you can download the CLI jar and then use it from the command line or directly use the gradle/maven plugin.
Is it this #827 ? If not please create a separated issue with a minimal spec to reproduce your issue... |
@marcelstoer we only added the mustache tags for oneOf, anyOf and allOf but have not yet updated the templates for all the languages/generators to take advantage of these new features in OAS v3. For Java client, please open a new issue with a spec and the current vs expected output for tracking. |
@YeTingGe are you free for a quick chat via https://gitter.im (ID: wing328) about your use case? |
@wing328 TypeScript generator has a weird side effect in which the interface property typing is prefixed with the word
We need to define |
I found interesting part in ReDoc petstore.yaml OpenAPI 3.0 sample: requestBodies:
Pet:
content:
application/json:
schema:
allOf:
- description: My Pet
title: Pettie
- $ref: '#/components/schemas/Pet' I think it is some kind of inline overriding of default models using allOf notation |
#vars does not include inherited variables on 2019-01-23 |
* add oneOf support to Ruby * add anyOf support to ruby client * add discriminator support to ruby client * fix typo * update samples, fix NPE * better format in ruby generator * fix test cases, disable mapping test * fix update script, update samples * add test, fix mapping * update exit code * reenabled discriminator test * remove duplicated properties * add test for duplicated properties * update samples, add new spec * fix ruby test cases * fix hasMore after removing duplicates * refactor method, comment out haskell client test * fix hasMore and update samples * fix parent detection * fix discriminator check * [haskell-http-client] need to use {{vars}}{{required}} instead of {{requiredVars}} * remove deprecated methods in default codegen (OpenAPITools#1031) * regenerate samples * remove commented code
Am I right to think this has only been implemented for ruby? |
@jazkal According to #10010, as of Jan 2022, it does seem like this is only solved for Ruby. |
Composition in the root level or in deeper inline levels is working in python-experimental Here is a PR that shows composition in inline schemas working #11420 |
PR checklist
./bin/
to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.sh
and./bin/security/{LANG}-petstore.sh
if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\
.master
,3.4.x
,4.0.x
. Default:master
.Description of the PR
allOf
,anyOf
,oneOf
Related issues/PRs
cc @OpenAPITools/generator-core-team