Describe the bug
When working with a jsonschema and invoking the model generator, one encounters following error:
Modular references require an output directory, not a file
It appears that the naming causes this error
"title": "GenomeStudio 2.0 - Methylation Module",
To Reproduce
Example schema:
{
"title": "test",
"type": "object",
"properties": {
"Liquid Biomarkers Input Data": {
"type": "object",
"properties": {
"Methylomics": {
"title": "Methylomics",
"type": "object",
"properties": {
"Software": {
"title": "Software",
"type": "object",
"anyOf": [
{
"title": "GenomeStudio 2.0 - Methylation Module",
"type": "object",
"properties": {
"GenomeStudio": {
"title": "GenomeStudio",
"type": "object",
"properties": {},
"required": [],
"additionalProperties": false
}
},
"additionalProperties": false
}
]
}
},
"required": [],
"additionalProperties": false
}
},
"required": []
}
},
"additionalProperties": false,
"required": []
}
Used commandline:
$ datamodel-codegen --use-annotated --use-title-as-name --use-subclass-enum --disable-appending-item-suffix --input-file-type jsonschema --input EnigmaContentModel.json --output testEnigmaModel.py --output-model-type pydantic_v2.BaseModel --allow-population-by-field-name --snake-case-field
Expected behavior
Should not produce any modular reference errors
.
Version:
Additional context
Changing the tittle to simple naming eliminates the issue: such as "title": "GenomeStudio",
So basically removing .
from the title does not produce this bug
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too