You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
IllegalArgumentException: "Invalid ref..." when uses an external link like "../demo#/components" #810
Hello, thinks for the nice tools, but i faced a problem where when i uses an external link, an exception was thrown Exception in thread "main" java.lang.IllegalArgumentException: Invalid ref: ../../common/restapi-sdk-data-schemas.yaml#/components/schemas/ApiError at org.openapitools.openapidiff.core.utils.RefPointer.getRefName(RefPointer.java:60) at org.openapitools.openapidiff.core.utils.RefPointer.resolveRef(RefPointer.java:16) at org.openapitools.openapidiff.core.compare.SchemaDiff.computeDiffForReal(SchemaDiff.java:340) at org.openapitools.openapidiff.core.model.deferred.DeferredSchemaCache.processSchemaQueue(DeferredSchemaCache.java:86) at org.openapitools.openapidiff.core.model.deferred.DeferredSchemaCache.process(DeferredSchemaCache.java:64) at org.openapitools.openapidiff.core.compare.OpenApiDiff.compare(OpenApiDiff.java:113) at org.openapitools.openapidiff.core.compare.OpenApiDiff.compare(OpenApiDiff.java:72) at org.openapitools.openapidiff.core.OpenApiCompare.fromSpecifications(OpenApiCompare.java:166) at org.openapitools.openapidiff.core.OpenApiCompare.fromSpecifications(OpenApiCompare.java:153)
After read sourcecode, i think i have no any way to trun off the checks on ref
While that is one possible format for internal references, it is not the only valid way to specify a reference. There are other possible formats for internal references, such as the #/definitions/myElement mentioned in the linked docs. There can also be remote references or URL references, and it is possible for remote or URL references to either reference an entire file (../../my-file.yaml) or reference a specific element in that file (../../my-file.yaml#/path/to/ref).
Activity
DrSatyr commentedon Aug 21, 2025
@lovesickness-pika could you please clarify what you mean by external link like "../demo#/components"
ctreatma commentedon Dec 11, 2025
I'm running into this issue as well. The
RefPointerclass has strict validation on the format of a$ref, requiring all$refpointers to be in the form#/components/<kind>/<ref name>.While that is one possible format for internal references, it is not the only valid way to specify a reference. There are other possible formats for internal references, such as the
#/definitions/myElementmentioned in the linked docs. There can also be remote references or URL references, and it is possible for remote or URL references to either reference an entire file (../../my-file.yaml) or reference a specific element in that file (../../my-file.yaml#/path/to/ref).