Skip to content

CLI flag --input is ignored when url is set in pyproject.toml #3076

@vdusek

Description

@vdusek

Description

When url is configured in the [tool.datamodel-codegen] section of pyproject.toml, the --input CLI flag is silently ignored, and the tool fetches from the configured URL instead of reading the specified local file.

Reproduction

Config (pyproject.toml):

[tool.datamodel-codegen]
url = "https://example.com/openapi.json"
input_file_type = "openapi"
output = "src/my_package/_models.py"

Command:

datamodel-codegen --input local-openapi.json

Expected behavior: The tool should use local-openapi.json as input, since the CLI flag was explicitly provided. CLI arguments should take precedence over config file settings.

Actual behavior: The tool ignores --input and fetches from the url defined in pyproject.toml.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions