Is your feature request related to a problem? Please describe.
I'm struggling to write a schema file to use as input to datamodel-codegen
that "combines" multiple schema files using $ref
s. Is something like this possible?
Input JSON schema files (downloaded to local folder):
I've tried something along the lines of the following:
{
"allOf": [
{ "$ref": "specification-1.5/schema/bom-1.3.schema.json" },
{ "$ref": "specification-1.5/schema/bom-1.4.schema.json" },
{ "$ref": "specification-1.5/schema/bom-1.5.schema.json" }
]
}
as well as anyOf
and oneOf
.
With the --use-title-as-name
flag, it seems to dump everything into an __init__.py
file (with repetitive class names like ComponentType
, ComponentType1
, ComponentType2
) along with an additional spdx.py
file.
Without the flag, it generates the folder structure
output_models/
βββ __init__.py
βββ bom_1
β βββ __init__.py
β βββ field_3.py
β βββ field_4.py
β βββ field_5.py
βββ spdx.py
Describe the solution you'd like
Desired generated model directory structure:
output_models
βββ cyclonedx_1_3.py
βββ cyclonedx_1_4.py
βββ cyclonedx_1_5.py
βββ jsf_0_82.py
βββ spdx.py
Describe alternatives you've considered
Additional context
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