OAS $ref statement during validation

Hello,

I’ve applied OAS validation policy in the preflow of a proxy endpoint. The validation uses an OAS file (or contract) which contains references to external/remote schemas, using the statement OAS $ref.

Example:

“$ref": "common.v1.oas.json#/components/parameters/API-GW-Header-Organisation”

Before executing the validation, I loaded all remote schemas, like "common.v1.oas.json", through the API REST of the Management Server. Example:

CURL "http://sd5268v.xxx.be:8080/v1/organizations/xxx/environments/test/resourcefiles?name=common.v1.oas.j..." \
-X POST \
-H "Content-type:multipart/form-data" \
-F "file=@common.v1.oas.json" \
-u spw-xxxx:xxxxx

However, during the OAS validation, apigee raises the following fault:

{
"fault" : {
"faultstring" : "OASValidation : Compilation of OASResource oas://dataFlow.management.v1.oas.json failed with error:java.lang.IllegalArgumentException: com.atlassian.oai.validator.OpenApiInteractionValidator$ApiLoadException: Unable to load API spec from provided URL or payload:\n\t- Unable to load RELATIVE ref: ./common.v1.oas.json path: .. Context {2}",
"detail" : {
"errorcode" : "steps.oasvalidation.OasCompilationFailed"
}
}
}

I thought apigee supported $ref command, as it supports OAS v3.

Could you let me know how I can use the $ref statement, please?

 Thanks,

0 1 206
1 REPLY 1

FYI: all OAS file have 'env' scope