Follow-up to: #523
Schema names in the spec embed version numbers and duplicate the type name:
ServiceRoot_v1_20_0_ServiceRoot
Message_v1_2_1_Message
AccountService_v1_18_1_AccountService
SecureBootDatabaseCollection_SecureBootDatabaseCollection
Since only one version of each schema exists in the spec at a time, the version in the key name is redundant. These names produce verbose generated types in every code generation tool (e.g. ServiceRootV120ServiceRoot, MessageV121Message).
What consumers do today
Consumers of the Redfish spec often implement some variation of the following post-processing to get clean type names:
- Strip version markers:
ServiceRoot_v1_20_0_ServiceRoot → ServiceRootServiceRoot
- Deduplicate prefixes:
ServiceRootServiceRoot → ServiceRoot
- Rewrite all
$ref pointers throughout the spec to match the renamed keys
- Handle collisions when two schemas would map to the same clean name
For our project, this is ~150 lines of tree-walking code with workarounds for bundler internal state.
We understand DMTF has reasons for the current naming structure in the individual schema files.
Proposal
If DMTF publishes a pre-bundled spec (per the companion request #523), the bundling pipeline could apply these transforms as a build step — producing clean schema names in the bundled output while preserving the existing naming in the source files.
# In the bundled spec
components:
schemas:
ServiceRoot:
x-schema-version: '1.20.0'
description: The ServiceRoot schema...
The x-schema-version extension preserves version info for consumers that need it, while the schema key itself produces clean generated types. The source schema files and their naming conventions remain unchanged.
Follow-up to: #523
Schema names in the spec embed version numbers and duplicate the type name:
Since only one version of each schema exists in the spec at a time, the version in the key name is redundant. These names produce verbose generated types in every code generation tool (e.g.
ServiceRootV120ServiceRoot,MessageV121Message).What consumers do today
Consumers of the Redfish spec often implement some variation of the following post-processing to get clean type names:
ServiceRoot_v1_20_0_ServiceRoot→ServiceRootServiceRootServiceRootServiceRoot→ServiceRoot$refpointers throughout the spec to match the renamed keysFor our project, this is ~150 lines of tree-walking code with workarounds for bundler internal state.
We understand DMTF has reasons for the current naming structure in the individual schema files.
Proposal
If DMTF publishes a pre-bundled spec (per the companion request #523), the bundling pipeline could apply these transforms as a build step — producing clean schema names in the bundled output while preserving the existing naming in the source files.
The
x-schema-versionextension preserves version info for consumers that need it, while the schema key itself produces clean generated types. The source schema files and their naming conventions remain unchanged.