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] [Python] nullable reference not generating any_of_x #2090

Open
6 tasks
nathan5280 opened this issue Feb 7, 2019 · 2 comments
Open
6 tasks

[BUG] [Python] nullable reference not generating any_of_x #2090

nathan5280 opened this issue Feb 7, 2019 · 2 comments

Comments

@nathan5280
Copy link

nathan5280 commented Feb 7, 2019

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • What's the version of OpenAPI Generator used?
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Bounty to sponsor the fix (example)
Description

I'm still having problems with the nullable reference. I've used the anyOf trick which passes the specification validation, but fails at runtime because the models.any_of_tier module is not generated.

ModuleNotFoundError: No module named '<my_package>.openapi_server.models.any_of_tier'

openapi-generator version

I just pulled the latest docker image.

OpenAPI declaration file content or url
        tier:
          anyOf:
            - $ref: '#/components/schemas/Tier'
          nullable: True

(for YAML code) or

Command line used for generation

docker run --rm -v ${BUILD_DIR}:/local openapitools/openapi-generator-cli generate
-i local/${ENDPOINT_SPEC}
-g python-flask
-o /local

Steps to reproduce

submit a request with tier: null

Related issues/PRs

OAI/OpenAPI-Specification#1368

Suggest a fix

I've also tried:
alllOf and get
validation error: None is not of type 'object'
which makes sense because tier doesn't exist.

oneOf generates the same error as anyOf.
models.one_of_tier
ModuleNotFoundError: No module named '<my_package>.openapi_server.models.one_of_tier'

@auto-labeler
Copy link

auto-labeler bot commented Feb 7, 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.

@sebastien-rosset
Copy link
Contributor

sebastien-rosset commented Jan 30, 2020

Are you still having the issue? I've opened a related issue to hopefully clarify the mix of inline and reference: OAI/OpenAPI-Specification#2120

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants