Reduce redundancy in generated OpenAPI definition names
Problem
Generated OpenAPI definitions repeat the same hierarchy in every type name.
This is not limited to schemas. The same pattern appears across:
- Operations
- Path items
- Parameters
- Request bodies
- Responses
- Schemas
- Tags
For example:
WebMenuCreateOperation
WebMenuUpdateOperation
WebMenuIdPathItems
WebMenuCreateRequestBody
WebMenuDetailResponse
WebMenuCreateSchema
WebMenuTag
Repeating the resource hierarchy in every generated type makes the code unnecessarily verbose and increases the risk of inconsistent naming or typos.
Proposal
Generate nested namespaces that mirror the OpenAPI resource hierarchy.
For example:
enum Web {
enum Menu {
struct CreateOperation: OperationRepresentable { ... }
struct UpdateOperation: OperationRepresentable { ... }
struct IdPathItems: PathItemRepresentable { ... }
struct CreateRequestBody: RequestBodyRepresentable { ... }
struct DetailResponse: JSONResponseRepresentable { ... }
struct CreateSchema: ObjectSchemaRepresentable { ... }
struct Tag: TagRepresentable { ... }
}
}
References would then become:
Web.Menu.CreateOperation()
Web.Menu.IdPathItems()
Web.Menu.DetailResponse()
Web.Menu.CreateSchema()
Benefits
- Less redundant generated code.
- Names mirror the OpenAPI resource hierarchy.
- Shorter and more readable type names.
- Reduced risk of naming inconsistencies and typos.
- Easier navigation and refactoring.
Screenshots

Reduce redundancy in generated OpenAPI definition names
Problem
Generated OpenAPI definitions repeat the same hierarchy in every type name.
This is not limited to schemas. The same pattern appears across:
For example:
Repeating the resource hierarchy in every generated type makes the code unnecessarily verbose and increases the risk of inconsistent naming or typos.
Proposal
Generate nested namespaces that mirror the OpenAPI resource hierarchy.
For example:
References would then become:
Benefits
Screenshots