oscerd commented on PR #28183:
URL: https://github.com/apache/camel/pull/28183#issuecomment-6499613368
Addressed the root `#` reference handling in OpenAPI 3.1 specifications
(commit 7224179a):
1. **Root `#` references in OpenAPI 3.1:** `inside()` now always adds a
`Target` (using `LOCAL_URI` as location for the root document) with the
fragment and the holder's inherited `$ids`. When following the target, the root
tree is indexed under `LOCAL_URI` and `select()` evaluates the fragment against
that node, resolving with the effective base (`targetBase`).
2. **Comment added:** Added the requested comment above
`ReferenceVisitor.deserializeIntoTree` explaining that it relies on
swagger-parser's internal SnakeYAML instance rather than the configurable
`LoaderOptions`.
3. **Tests added in both modules:**
- `localChecksARootFragmentAgainstTheInheritedId` /
`checksARootFragmentAgainstTheInheritedId`: `components.schemas.A` with an http
`$id` points to `#/components/schemas/X`, where `X` has `owner: $ref
owner.yaml`. Proves that under `local` the check evaluates `owner.yaml` with
the inherited `$id` base, rejecting it with 0 HTTP requests (`all` control
fetches `/schemas/owner.yaml`).
- `localChecksARootFragmentWithoutTheIdsAboveIt` /
`checksARootFragmentWithoutTheIdsAboveIt`: root references
`#/components/schemas/P/$defs/X` where `P` has relative `$id: sub/`. Proves
that `X` is traversed with the root's base (`LOCAL_URI`), resolving
`owner.yaml` relative to root rather than `sub/`, rejecting it with 0 HTTP
requests (`all` control fetches `/schema.yaml`).
All 236 tests in `camel-rest-openapi` and 123 tests in `camel-openapi-java`
pass, and formatting checks are clean.
_Claude Code on behalf of oscerd_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]