Currently in openapi.yml dots are used in the schema name.
Example (from https://github.com/flexiblepower/s2-ws-json/blob/v0.0.2-beta/s2-schemas-in-openapi-format/s2-ws-json-openapi.yml#L798C10-L798C21):
DDBC.TimerStatus:
type: object
This causes the $ref to also contain a dot in the name `. An example may be found here: https://github.com/flexiblepower/s2-ws-json/blob/v0.0.2-beta/s2-schemas-in-openapi-format/s2-ws-json-openapi.yml#L1111
allowed_limit_ranges:
type: array
minItems: 2
maxItems: 100
items:
$ref: '#/components/schemas/PEBC.AllowedLimitRange'
Dots are allowed according to the OpenAPI & jsonschema specifications. However, datamodel-codegen (the Python code generator) handles it erronously by assuming it is part of a path and switches over from single file to modular code generation. Issues at datamodel-codegen already exist:
koxudaxi/datamodel-code-generator#1600
koxudaxi/datamodel-code-generator#2039
Dots are not allowed in Python class names (nor in many other languages) so even if any issues are fixed, the result will not match the openapi specification exactly.
Therefor, the proposal is to remove the dot from the schema name (only) so (faulty) generators will not have a hard time and the result is the same across code generators (as some generators may replace a dot with any replacement of their choosing such as -, _ or just remove it). This would leave the dot intact in the message_type field as according to the specification.
Currently in
openapi.ymldots are used in the schema name.Example (from https://github.com/flexiblepower/s2-ws-json/blob/v0.0.2-beta/s2-schemas-in-openapi-format/s2-ws-json-openapi.yml#L798C10-L798C21):
This causes the
$refto also contain a dot in the name `. An example may be found here: https://github.com/flexiblepower/s2-ws-json/blob/v0.0.2-beta/s2-schemas-in-openapi-format/s2-ws-json-openapi.yml#L1111Dots are allowed according to the OpenAPI & jsonschema specifications. However, datamodel-codegen (the Python code generator) handles it erronously by assuming it is part of a path and switches over from single file to modular code generation. Issues at datamodel-codegen already exist:
koxudaxi/datamodel-code-generator#1600
koxudaxi/datamodel-code-generator#2039
Dots are not allowed in Python class names (nor in many other languages) so even if any issues are fixed, the result will not match the openapi specification exactly.
Therefor, the proposal is to remove the dot from the schema name (only) so (faulty) generators will not have a hard time and the result is the same across code generators (as some generators may replace a dot with any replacement of their choosing such as
-,_or just remove it). This would leave the dot intact in themessage_typefield as according to the specification.