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

option to generate schemas using 'allOf' to override default/etc rather than 'oneOf' #1509

Open
hauntingEcho opened this issue Mar 25, 2022 · 1 comment

Comments

@hauntingEcho
Copy link

hauntingEcho commented Mar 25, 2022

Due to not-great ecosystem support of allOf/anyOf/oneOf, it would be helpful to be able to configure which to use when generating a construct like

schema:
  default: ascending
  oneOf:
    - $ref: #/components/schemas/SortOrder

In particular, Swagger-UI only handles enums correctly if allOf is used, but currently oneOf is generated. The documentation for "AllowReferencesWithProperties" already mentions that "allOf/oneOf with $ref" may be used

This would resolve the NSwag issue: RicoSuter/NSwag#3645

edit: It looks like the relevant code is here

@Red1408192
Copy link

the piece of code you reference doesn't seems to fix the issue of the missing dropbox for the enum parameters (you linked this issue in there), it only applies to the models and not to the api parameters

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

No branches or pull requests

2 participants