Custom datamodel-code-generator templates used when generating models.py from the OpenTelemetry configuration JSON schema.
Extends the default dataclass template to support additionalProperties from the JSON Schema. Schema types that allow additional properties (e.g. Sampler, SpanExporter, TextMapPropagator) get:
@_additional_propertiesdecorator — captures unknown constructor kwargsadditional_properties: ClassVar[dict[str, Any]]annotation — satisfies type checkers without creating a dataclass field
This enables plugin/custom component names to flow through typed dataclasses without a post-processing step.
Templates are applied automatically when regenerating models:
tox -e generate-config-from-jsonschemaThe template directory is configured in pyproject.toml under [tool.datamodel-codegen].
See opentelemetry-sdk/src/opentelemetry/sdk/_configuration/README.md for the full schema update workflow.