Skip to content

Fix order-dependent hashing in OpenAPIObjectContainer and OpenAPIValueContainer - #195

Open
andrii-vysotskyi-maudau wants to merge 3 commits into
apple:mainfrom
andrii-vysotskyi-maudau:fix/object_container_hash
Open

Fix order-dependent hashing in OpenAPIObjectContainer and OpenAPIValueContainer#195
andrii-vysotskyi-maudau wants to merge 3 commits into
apple:mainfrom
andrii-vysotskyi-maudau:fix/object_container_hash

Conversation

@andrii-vysotskyi-maudau

@andrii-vysotskyi-maudau andrii-vysotskyi-maudau commented May 11, 2026

Copy link
Copy Markdown

Motivation

OpenAPIObjectContainer and OpenAPIValueContainer’s hash(into:) depends on dictionary iteration order. This can cause equal values to produce different hashes, violating Hashable requirements.

Modifications

Updated hash(into:) to sort keys before hashing.

Result

Equal objects are now guaranteed to produce same hash value.

Test Plan

Added a regression test verifying hash stability.

@andrii-vysotskyi-maudau

Copy link
Copy Markdown
Author

Hi @simonjbeaumont - I noticed you were active on some recent PRs. If you have time, would you mind taking a look at this one? I’d appreciate any feedback. Thanks!

@andrii-vysotskyi-maudau andrii-vysotskyi-maudau changed the title Fix order-dependent hashing in OpenAPIObjectContainer Fix order-dependent hashing in OpenAPIObjectContainer and OpenAPIValueContainer Aug 14, 2026
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