Skip to content

[python] fix uniqueItems validation tests#24092

Merged
wing328 merged 1 commit into
OpenAPITools:masterfrom
tamird:codex/python-remove-stale-unique-items-test
Jun 22, 2026
Merged

[python] fix uniqueItems validation tests#24092
wing328 merged 1 commit into
OpenAPITools:masterfrom
tamird:codex/python-remove-stale-unique-items-test

Conversation

@tamird

@tamird tamird commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Pydantic 2 removed conlist(unique_items=True). The migration in
04fa53b kept OpenAPI arrays as lists because sets would lose ordering
and complicate JSON serialization, but left these tests behind.

The tests do not require an exception, so they normally pass after
making a Petstore request. They fail when that request produces an
unrelated response validation error. Remove them from the two Pydantic 2
samples; the Pydantic 1 sample still exercises the supported validation.


Summary by cubic

Remove duplicate-item validation tests from Petstore samples on python and python-lazyImports (Pydantic v2) to align with removal of conlist(unique_items=True) and eliminate flaky failures. In python-pydantic-v1, require the expected ValidationError with assertRaisesRegex("the list has duplicated items") to prevent silent regressions.

Written for commit cb5bb55. Summary will update on new commits.

Review in cubic

@tamird tamird force-pushed the codex/python-remove-stale-unique-items-test branch from fb37fcc to 8d0a632 Compare June 22, 2026 13:44
@tamird tamird marked this pull request as ready for review June 22, 2026 13:45

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Re-trigger cubic

@tamird tamird force-pushed the codex/python-remove-stale-unique-items-test branch from 8d0a632 to 013d287 Compare June 22, 2026 13:50
@tamird tamird changed the title [python] remove stale uniqueItems tests [python] fix uniqueItems validation tests Jun 22, 2026
Pydantic 2 removed conlist(unique_items=True). The migration in
04fa53b kept OpenAPI arrays as lists because sets would lose ordering
and complicate JSON serialization, but left the old validation tests in
the synchronous and lazy-import samples.

Those tests do not require an exception, so they normally pass after
making a Petstore request and fail only when that request produces an
unrelated response validation error. Remove them from the Pydantic 2
samples.

Pydantic 1 still enforces uniqueItems. Make its test require the expected
validation error so a regression cannot silently pass.
@tamird tamird force-pushed the codex/python-remove-stale-unique-items-test branch from 013d287 to cb5bb55 Compare June 22, 2026 13:53
@wing328 wing328 added this to the 7.24.0 milestone Jun 22, 2026
@tamird

tamird commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

Also sent #24093 to cover incomplete triggers for this workflow.

@wing328

wing328 commented Jun 22, 2026

Copy link
Copy Markdown
Member

thanks for addressing the outdated tests

cc @cbornet (2017/09) @tomplus (2018/10) @krjakbrjak (2023/02) @fa0311 (2023/10) @multani (2023/10)

@wing328 wing328 merged commit bd1abad into OpenAPITools:master Jun 22, 2026
46 checks passed
@tamird tamird deleted the codex/python-remove-stale-unique-items-test branch June 22, 2026 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants