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

Support scientific notation (YeX) #1952

Open
swelborn opened this issue May 9, 2024 · 0 comments
Open

Support scientific notation (YeX) #1952

swelborn opened this issue May 9, 2024 · 0 comments

Comments

@swelborn
Copy link

swelborn commented May 9, 2024

Describe the bug
Scientific notation in json converts to str in model:

class Model(BaseModel):
    hello: str

To Reproduce

Example json:

{
    "hello": 1e-9
}

Used commandline:

$ datamodel-codegen --input-file-type json --input gen/test-meta.json --output gen/test_scientific_notation.py

Expected behavior
Expected float.

Version:

  • OS: macOS
  • Python version: 3.11.9
  • datamodel-code-generator version: 0.25.6
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