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

Superfluous underscore suffixes 'schema' field name #1833

Open
kingtistel opened this issue Feb 2, 2024 · 0 comments
Open

Superfluous underscore suffixes 'schema' field name #1833

kingtistel opened this issue Feb 2, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@kingtistel
Copy link

Describe the bug
From the json schema a property named 'schema' was created as a field named 'schema_'.

To Reproduce

Example schema:
https://schema.getpostman.com/json/collection/v2.1.0/collection.json

Used commandline:

$ datamodel-codegen --url https://schema.getpostman.com/json/collection/v2.1.0/collection.json --output-model-type typing.TypedDict --output postman_td.py

and equally:

$ datamodel-codegen --url https://schema.getpostman.com/json/collection/v2.1.0/collection.json --output-model-type dataclasses.dataclass --output postman_dc.py

Expected behavior
Expected that the 'Info' class would have a field named 'schema'. Instead it has a field named 'schema_'.

Version:

  • OS: macOS 14.3
  • Python version: 3.11.7
  • datamodel-code-generator version: 0.25.3

Additional context
Add any other context about the problem here.

@koxudaxi koxudaxi added the bug Something isn't working label Mar 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants