validator-badge icon indicating copy to clipboard operation
validator-badge copied to clipboard

Validator throws error for external references

Open ritwik-dell opened this issue 8 years ago • 5 comments

I have a Swagger file which has external references. Here is a snapshot of how I am calling out the external reference:

    "definitions": {
        "Car": {
            "$ref": "./common/schema/car.schema"
        }
    },

Here is how the car.schema file looks like:

{
  "type": "object",
  "properties": {
    "vin": {
      "type": "string"
    },
    "year": {
      "type": "integer"
    },
    "make": {
      "type": "string"
    },
    "model": {
      "type": "string"
    }
  },
  "required": [
    "vin",
    "year",
    "make",
    "model"
  ]
}

Now Swagger editor and SwaggerUI does not throw an error (There was a problem in SwaggerUI, but it was fixed). However, the validator-badge keeps complaining that there is an error.

Unfortunately the only details it provided was:

{"messages":["malformed or unreadable swagger supplied"]}

Please help.

ritwik-dell avatar Nov 02 '16 04:11 ritwik-dell

I'm getting the same issue. Does anyone can help?

huyngo avatar Nov 26 '17 13:11 huyngo

Hi @huyngo can you please provide the spec files?

gracekarina avatar Nov 26 '17 20:11 gracekarina

It seems that @huyngo didn't provide the spec files. Too bad because this is an issue for me as well.

denarced avatar Aug 28 '18 06:08 denarced

Hi, can you please provide your spec files or maybe a PR with a failing test with the specs? Thanks in advance @denarced

gracekarina avatar Aug 28 '18 13:08 gracekarina

Hi, is there any update in this issue, I'm getting this error while converting config file 2.0 to 3.0 using swagger-converter. Due to external references in config files.

bhardwz avatar Dec 02 '22 12:12 bhardwz