gnodet-bot commented on code in PR #28670:
URL: https://github.com/apache/camel/pull/28670#discussion_r4410289841
##########
components/camel-openapi-java/src/main/java/org/apache/camel/openapi/OpenApiExternalReferences.java:
##########
@@ -485,9 +495,8 @@ private void inside(
}
String origin = where(ref, path, name);
lookups.add(new Lookup(uri, document, document != null ? document
: LOCAL_URI, origin));
- if (document != null) {
- targets.add(new Target(document, fragment, ref, origin, ids,
holder));
- }
+ // the parser takes only the part the reference selects, under the
$ids of the schemas enclosing the reference
Review Comment:
💡 **Minor suggestion:** This comment explains what the new code does, but
doesn't note *why* the previous `document != null` guard was removed. Without
that guard, in-spec `#`-references were silently dropped (the old code skipped
`targets.add()` when `document` was `null`, meaning any reference back into the
specification root was simply not followed). A brief note here would help
future readers:
```suggestion
// previously, the document != null guard caused in-spec
#-references to be silently ignored;
// now we always add the target, substituting LOCAL_URI when
document is null (in-spec reference)
// the parser takes only the part the reference selects, under
the $ids of the schemas enclosing the reference
```
--
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]