Skip to content

Duplicate model names generated for FlowSegment, FlowSegmentPost and DeletionRequest #201

Description

@Shaun-3adesign

Describe the bug
When generating server stubs from TimeAddressableMediaStore.yaml using openapitools/openapi-generator-cli, three schemas produce duplicate model pairs: FlowSegment / FlowSegment1, FlowSegmentPost / FlowSegmentPost1, and DeletionRequest / DeletionRequest1. Both models in each pair are structurally identical. A developer implementing the server traits has no clear basis for choosing between them.

Expected behavior
Each schema should produce a single, consistently named model.

Suggested fix
Register each schema once in components/schemas in the root YAML and replace all direct $ref: schemas/<file>.json usage sites with $ref: '#/components/schemas/<Name>'. The generator deduplicates schemas keyed on their components/schemas path, so all references to the same entry resolve to one model.

Additional context
The root cause is that the same external schema file is referenced at multiple distinct YAML paths. The generator resolves each path independently and treats them as separate schemas. This is a spec convention issue rather than a generator bug — using components/schemas is the intended OpenAPI pattern for shared, reusable schemas.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Task.

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions