Skip to content

Allow object-aware external dereference component keys#490

Open
ayushshrivastv wants to merge 4 commits intomattpolzin:mainfrom
ayushshrivastv:ExternalLoader.swift
Open

Allow object-aware external dereference component keys#490
ayushshrivastv wants to merge 4 commits intomattpolzin:mainfrom
ayushshrivastv:ExternalLoader.swift

Conversation

@ayushshrivastv
Copy link
Contributor

Closes #438

Summary

  • add an object-aware ExternalLoader.componentKey overload in both OpenAPIKit variants
  • keep the URL-only key path as the compatibility fallback so loaders can implement either form
  • compute external reference component keys after loading so the decoded value can inform the key
  • add regression tests covering the object-aware override path and the default compatibility path

Testing

  • swift test --filter JSONReferenceTests
  • swift test --filter ExternalDereferencingDocumentTests

@ayushshrivastv
Copy link
Contributor Author

Follow-up on the CI failures for this branch.

What changed:

  • Replaced the async let fan-out in both Path Item/DereferencedPathItem.swift implementations with sequential awaits.
  • Replaced the task-group based concurrent traversal in the shared collection external-dereferencing helpers with sequential traversal:
    • Array+ExternallyDereferenceable.swift
    • Dictionary+ExternallyDereferenceable.swift
    • OrderedDictionary+ExternallyDereferenceable.swift
    • in both OpenAPIKit and OpenAPIKit30

Why:

  • The failing jobs were not hitting the new object-aware ExternalLoader.componentKey behavior itself.
  • CI was crashing in ExternalDereferencingDocumentTests.test_example on Linux/nightly paths while external references were being loaded concurrently.
  • The stack traces consistently pointed into the external dereferencing pipeline during parallel loads, including PathItem dereferencing and the shared collection helpers that fan out work across arrays and dictionaries.
  • Serializing those dereference/load paths avoids the runtime instability while preserving the behavior of the feature change in this PR.

What I verified locally:

  • swift test --filter ExternalDereferencingDocumentTests -Xswiftc -strict-concurrency=complete
  • swift test --filter JSONReferenceTests -Xswiftc -strict-concurrency=complete
  • git diff --check

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.

More informed external dereference component key function

1 participant