-
Notifications
You must be signed in to change notification settings - Fork 76
[Task]: OpenAPI Spec: Duplicate Model Name Conflict #1371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
FullWorkspace
/FullWorkspace-Output
, WorkspaceConfig
/WorkspaceConfig-Output
)
@peppescg / @alex-mcgovern would this need patching in codegate-ui (generate post a PR merging to fix the above)? |
Yep, once we merge this fix we need to update the openapi.json in the UI( we have a script that do it automatically ), and generate all the ts interfaces and endpoint wrappers |
@lukehinds free feel to assign to me I can handle both BE and FE |
Renamed schemas ending with '-Input' and '-Output' (e.g., FullWorkspace-Input, WorkspaceConfig-Output) to avoid duplicate model name errors during client generation (e.g., FullWorkspaceInput, WorkspaceConfigOutput). Updated all corresponding $ref references within the OpenAPI specification. This resolves warnings and errors encountered when running `make generate-client`. Resolves: #1371
Description
I encountered an issue while trying to generate a client library from the
api/openapi.json
specification using theopenapi-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 toFullWorkspace
.#/components/schemas/WorkspaceConfig
and#/components/schemas/WorkspaceConfig-Output
both seem to normalize toWorkspaceConfig
.Impact:
This naming collision prevents the generator from creating the necessary models, resulting in warnings and errors like:
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 theopenapi.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
The text was updated successfully, but these errors were encountered: