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

CLI options use-standard-collections and use-union-operator are not being applied for input file type graphql #1941

Open
paultop6 opened this issue Apr 30, 2024 · 1 comment

Comments

@paultop6
Copy link

paultop6 commented Apr 30, 2024

Describe the bug
CLI options use-standard-collections and use-union-operator are not being applied for input file type graphql

To Reproduce

Example schema:

 type DummyType {
    id: ID!
    label: String!
    value: Int
}

type DummyType2 {
    list_types: [DummyType]
}

Used commandline:

$ datamodel-codegen --input test.graphql --input-file-type=graphql --output-model-type pydantic_v2.BaseModel --use-standard-collections --use-union-operator --output test_models.py

Expected behavior
Optional should be replaced by union operator |, e.g. Optional[str] should be replaced by str | None. List should be replaced by standard type list

Version:

  • OS: MAC OS Sonoma 14.4.1
  • Python version: 3.11.9
  • datamodel-code-generator version: 0.25.6

Additional context
Add any other context about the problem here.

@paultop6
Copy link
Author

paultop6 commented May 1, 2024

I have also noticed the same behaviour with option --use-default-kwarg

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