Validation return not resolvable error external references in swagger document

Issue #78 resolved
Former user created an issue

Hi,

I have made a reference to external file in my swagger document as follows:

"definitions": {
        "commonStatus": {
            "$ref": "file://definitions/common/status.json"
        }, ...
}

The external file is referenced fine when the SwaggerValidator class is built, but when validating the response against this swagger, i get the following error.

[ERROR - JSON Reference "#/definitions/file://definitions/common/status.json" cannot be resolved: []]

On debugging, i noticed that, when the final json schema is created for response body to be validated against, it contains the above reference as follows:

{ ...   "definitions": {
        "commonStatus": {
            "$ref": "#/definitions/file://definitions/common/status.json",
            "additionalProperties": false
        }, ...
}

I think it should be

"$ref": "file://definitions/common/status.json",

Comments (1)

  1. Log in to comment