Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openapi3: delete origin keys only when IncludeOrigin=true #1055

Merged
merged 6 commits into from
Mar 12, 2025

Conversation

reuvenharrison
Copy link
Contributor

@reuvenharrison reuvenharrison commented Mar 7, 2025

This PR fixes #1051.
The problem was caused because openapi3 removed origin keys from Schema.Properties and other map-based types including all Components types.
To fix this I changed the behavior to only delete origin keys when IncludeOrigin is set to true.
Note that this required moving Loader.IncludeOrigin to the global scope so that map unmarshalling functions can access it.
For example: Schemas.UnmarshalJSON -> unmarshalStringMapP -> popOrigin which accesses IncludeOrigin

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@reuvenharrison reuvenharrison marked this pull request as draft March 7, 2025 09:13
@reuvenharrison reuvenharrison changed the title fix issue 1051 openapi3: fix issue 1051 Mar 8, 2025
@reuvenharrison reuvenharrison marked this pull request as ready for review March 8, 2025 21:17
@fenollp
Copy link
Collaborator

fenollp commented Mar 10, 2025

LGTM but please rebase now that I merged #1057
Also please rename the PR to something that makes standalone sense.

@reuvenharrison reuvenharrison changed the title openapi3: fix issue 1051 openapi3: delete origin keys only when IncludeOrigin=true Mar 10, 2025
@reuvenharrison
Copy link
Contributor Author

@fenollp the PR is ready to merge

@fenollp fenollp merged commit a34baf0 into getkin:master Mar 12, 2025
5 checks passed
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.

Field named "origin" is not loaded
2 participants