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

Enum is not being generated from JSON Schema from URL #1963

Open
coldenol opened this issue May 15, 2024 · 1 comment
Open

Enum is not being generated from JSON Schema from URL #1963

coldenol opened this issue May 15, 2024 · 1 comment

Comments

@coldenol
Copy link

coldenol commented May 15, 2024

Describe the bug
A clear and concise description of what the bug is.

I'm trying to generate models from the skyscanner public JSON schema from here: partnerportal.skyscanner.net
where they have enums like this one:
image

But instead of enum an empty base class is being created:
image

To Reproduce

Example schema:
partnerportal.skyscanner.net

Used commandline:

$ datamodel-codegen --url https://partnerportal.skyscanner.net/tr-docs/static/push.schema.flights.v6.json --input-file-type jsonschema --use-subclass-enum --field-include-all-keys --output model.py
$ datamodel-codegen --url https://partnerportal.skyscanner.net/tr-docs/static/push.schema.flights.v6.json --input-file-type jsonschema --output model.py

Expected behavior
A clear and concise description of what you expected to happen.

The expected is the correct enum class like this:
image

Version:

  • OS: MacOS Sonoma 14.4.1
  • Python version: 3.12
  • datamodel-code-generator version: 0.25.6
@coldenol
Copy link
Author

Seems the following issue is about the same topic #1925

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