Skip to content

fix: prevent schema names from shadowing endpoint imports - #1490

Open
CodingCossack wants to merge 1 commit into
openapi-generators:mainfrom
CodingCossack:fix/1423-endpoint-import-collisions
Open

CodingCossack wants to merge 1 commit into
openapi-generators:mainfrom
CodingCossack:fix/1423-endpoint-import-collisions

Conversation

@CodingCossack

Copy link
Copy Markdown

Fixes #1423.

Schemas named Client, AuthenticatedClient, Response or HTTPStatus can shadow imports in generated endpoints, producing incorrect annotations or broken response handling. Bind endpoint-owned SDK symbols and HTTPStatus through private aliases, preserving user model names and public SDK types.

Functional regressions check resolved annotations, public exports, synchronous and asynchronous requests, parsed model and response wrapper identities, status codes and authenticated endpoint signatures, with Customer as a non-collision control. The generated fixture changes follow directly from the template aliases; a patch changeset is included.

Validation: 474 tests and 5 snapshots passed, plus lint, formatting and mypy. All 64 changed generated endpoint files are AST-equivalent after reversing the aliases and normalising import grouping/order.

Alias endpoint-owned Client, AuthenticatedClient, Response and HTTPStatus
imports while preserving generated model names and public SDK types.
Cover resolved annotations, request execution and response identities in
functional tests, and update generated fixtures and release notes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Model import shadows HTTP Client import when a schema is named Client

1 participant