Skip to content

Fix order-dependent hashing in OpenAPIObjectContainer#195

Open
andrii-vysotskyi-maudau wants to merge 1 commit into
apple:mainfrom
andrii-vysotskyi-maudau:fix/object_container_hash
Open

Fix order-dependent hashing in OpenAPIObjectContainer#195
andrii-vysotskyi-maudau wants to merge 1 commit into
apple:mainfrom
andrii-vysotskyi-maudau:fix/object_container_hash

Conversation

@andrii-vysotskyi-maudau
Copy link
Copy Markdown

Motivation

OpenAPIObjectContainer’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 use an order-independent hashing strategy, aligning it with Swift standard library’s approach.

Result

Behavior now matches Swift’s own Dictionary: Hashable implementation.

Test Plan

Added a regression test verifying hash stability.

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