Describe the bug
Within the OSCAL schema is:
"EmailAddressDatatype" :
{ "description" : "An email address string formatted according to RFC 6531.",
"allOf" :
[
{ "$ref" : "#/definitions/StringDatatype" },
{ "type" : "string",
"format" : "email",
"pattern" : "^.+@.+$" } ] },
An empty body is produced by datamodel-codegen:
class EmailAddressDatatype(OscalBaseModel):
"""
An email address string formatted according to RFC 6531.
"""
To Reproduce
Example schema (snippet):
"EmailAddressDatatype" :
{ "description" : "An email address string formatted according to RFC 6531.",
"allOf" :
[
{ "$ref" : "#/definitions/StringDatatype" },
{ "type" : "string",
"format" : "email",
"pattern" : "^.+@.+$" } ] },
Follow link above for full schema.
Used commandline:
datamodel-codegen --disable-timestamp --disable-appending-item-suffix --use-schema-description --input-file-type jsonschema --input release-1.1.2-schemas/oscal_assessment-plan_schema.json --base-class trestle.core.base_model.OscalBaseModel --output trestle/oscal/tmp/assessment_plan.py
Expected behavior
The generated code body should not be empty, but rather contain that which is found in the json schema.
Version:
Additional context
NA
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