Skip to content

Reject duplicate names for unreferenced lazy components - #1088

Open
galafis wants to merge 1 commit into
marshmallow-code:devfrom
galafis:fix-lazy-component-duplicates
Open

galafis wants to merge 1 commit into
marshmallow-code:devfrom
galafis:fix-lazy-component-duplicates

Conversation

@galafis

@galafis galafis commented Oct 24, 2026

Copy link
Copy Markdown

Registering a component with lazy=True does not reserve its name: another lazy registration silently replaces it, and an eager registration is silently replaced when the original lazy component is later referenced. Check both eager and lazy registries before registering schemas, responses, parameters, headers, examples, and links.

The parameterized regression covers all six component kinds and all four eager/lazy registration combinations, and checks that a rejected duplicate leaves the original definition intact.

Validation on Python 3.12.14 / marshmallow 4.3.1: regression before fix: 12 failed, 12 passed; full suite after fix: 660 passed, 6 skipped. Ruff lint/format and git diff --check pass.

This branch has not been deployed

No deployments
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.

1 participant