Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

[Task]: OpenAPI Spec: Duplicate Model Name Conflict #1371

Closed
@lukehinds

Description

@lukehinds

Description

I encountered an issue while trying to generate a client library from the api/openapi.json specification using the openapi-python-client tool (and likely other OpenAPI generators).

Problem:

The generator fails because it attempts to create duplicate model names. This seems to stem from the naming convention where schemas exist both with and without an -Output suffix, but normalize to the same name during generation.

Specifically, the following pairs cause conflicts:

  • #/components/schemas/FullWorkspace and #/components/schemas/FullWorkspace-Output both seem to normalize to FullWorkspace.
  • #/components/schemas/WorkspaceConfig and #/components/schemas/WorkspaceConfig-Output both seem to normalize to WorkspaceConfig.

Impact:
This naming collision prevents the generator from creating the necessary models, resulting in warnings and errors like:

WARNING parsing POST /api/v1/workspaces within code_gate_api.
Cannot parse response for status code 201 (Could not find reference in parsed models or enums), response will be omitted from generated client
Reference(ref='#/components/schemas/FullWorkspace-Output')
...
Unable to parse schema /components/schemas/FullWorkspace-Output
Unable to parse this part of your OpenAPI document: : Attempted to generate duplicate models with name "FullWorkspace"
...
Unable to parse schema /components/schemas/WorkspaceConfig-Output
Unable to parse this part of your OpenAPI document: : Attempted to generate duplicate models with name "WorkspaceConfig"

This makes it difficult to reliably generate clients that cover all workspace-related endpoints.

Suggested Solution:
Consider renaming the schemas with the -Output suffix to something distinct that won't clash after normalization. For example:

  • FullWorkspace-Output -> FullWorkspaceOutput
  • WorkspaceConfig-Output -> WorkspaceConfigOutput

Ensure all $ref pointers throughout the openapi.json file are updated accordingly.

This change would improve the spec's compatibility with standard OpenAPI tooling and make client generation more robust

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions