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

get_openapi_schema outputs types using anyOf style - doesn't work with the Swift OpenAPI generator #1151

Open
IanHoar opened this issue May 3, 2024 · 0 comments

Comments

@IanHoar
Copy link

IanHoar commented May 3, 2024

Hey there,

I'm working with a client team that is using django-ninja to build their API. They have handed me a schema.json file that I've converted to yaml and I'm trying to import into my Swift project. When I generate the client side code using the Swift OpenAPI Generator I get errors on every instance where I see this syntax:

my_property:
  anyOf:
    - type: string
    - type: 'null'

Hand converting to this syntax throughout the entire spec allows the generation to succeed:

my_property:
  type: [string, 'null']

My question is this: Is there a way to have django-ninja output this updated type style? Any information to help me wrap my head around this issue would be helpful

@IanHoar IanHoar changed the title get_openapi_schema outputs types using anyOf style - doesn't work the Swift OpenAPI generator get_openapi_schema outputs types using anyOf style - doesn't work with the Swift OpenAPI generator May 3, 2024
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

1 participant