We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug Does not generate an enumeration for oneOf + cost. For example, autocomplete in Jetbrains IDE works fine for this case.
To Reproduce
Example schema:
# definition nodeJsModeEnum: title: NodeJS mode type: string description: | A long description here. default: npm oneOf: - title: npm const: npm - title: yarn const: yarn - title: npm ci const: npm_ci # usage properties: mode: $ref: "#/definitions/nodejsModeEnum"
Used commandline:
pdm run datamodel-codegen --input config/schema/cd.schema.yaml --input-file-type jsonschema --output src/config/cd_model.py --output-model-type pydantic_v2.BaseModel # pyproject.toml options #[tool.datamodel-codegen] #field-constraints = true #snake-case-field = true #strip-default-none = false #target-python-version = "3.11"
Expected behavior
# expects class NodeJsModeEnum(Enum): npm = 'npm' yarn = 'yarn' npm_ci = 'npm_ci' # actual class NodeJsModeEnum(RootModel[str]): root: str = Field( ..., description='...' )
Version:
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
Does not generate an enumeration for oneOf + cost. For example, autocomplete in Jetbrains IDE works fine for this case.
To Reproduce
Example schema:
Used commandline:
Expected behavior
Version:
The text was updated successfully, but these errors were encountered: