Skip to content

Comments

Fix race condition and stale references in stripOAIGen#162

Open
fkollmann wants to merge 1 commit intogo-openapi:masterfrom
smartpricer:master
Open

Fix race condition and stale references in stripOAIGen#162
fkollmann wants to merge 1 commit intogo-openapi:masterfrom
smartpricer:master

Conversation

@fkollmann
Copy link

@fkollmann fkollmann commented Feb 20, 2026

Fixes non-deterministic behavior in flatten.go by:

  1. Sorting keys when iterating newRefs.
  2. Reloading spec analysis before stripOAIGen to fix stale references.
  3. Updating parents list of target definitions when handling transitive merges to prevent dangling references.

Fixes the following errors when running go-swagger flatten:

  • object has no key "XXXXOAIGen": JSON pointer error
  • object has no key "XXXXOAIGen1": JSON pointer error

Note: This PR was created using gemini-3-pro-preview.

- object has no key "XXXXOAIGen": JSON pointer error
- object has no key "XXXXOAIGen1": JSON pointer error

Signed-off-by: Felix Kollmann <mail@fkollmann.de>
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