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.
Description
When
urlis configured in the[tool.datamodel-codegen]section ofpyproject.toml, the--inputCLI flag is silently ignored, and the tool fetches from the configured URL instead of reading the specified local file.Reproduction
Config (
pyproject.toml):Command:
Expected behavior: The tool should use
local-openapi.jsonas input, since the CLI flag was explicitly provided. CLI arguments should take precedence over config file settings.Actual behavior: The tool ignores
--inputand fetches from theurldefined inpyproject.toml.