validator-badge: invalid swagger version "2.0"

When I export in json with Swagger UI, the swagger version is generated as: “swagger”: “2.0”,

but validator badge reports this as invalid:

[
    {
        "level": "error",
        "domain": "validation",
        "keyword": "enum",
        "message": "instance value (\"2.0\") not found in enum (possible values: [2.0])",
        "schema": {
            "loadingURI": "#",
            "pointer": "/properties/swagger"
        },
        "instance": {
            "pointer": "/swagger"
        }
    },
    {
        "level": "error",
        "domain": "validation",
        "keyword": "type",
        "message": "instance type (string) does not match any allowed primitive type (allowed: [\"integer\",\"number\"])",
        "schema": {
            "loadingURI": "#",
            "pointer": "/properties/swagger"
        },
        "instance": {
            "pointer": "/swagger"
        }
    }
]

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 16 (6 by maintainers)

Most upvoted comments

Just in case anyone finds this thread the same way I did, looking to fix this exception:

com.github.fge.jsonschema.core.exceptions.ProcessingException: fatal: unable to dereference URI "http://swagger.io/v2/schema.json#"

My machine has access to the web, but only via a proxy.

I had the proxy set for maven via its settings file, but I had to specify the proxies for the JRE too.

In my script which starts the validator badge server, I added:

export MAVEN_OPTS="-Dhttp.proxyHost={{proxy}} -Dhttp.proxyPort={{proxy port}} -Dhttps.proxyHost={{proxy}} -Dhttps.proxyPort={{proxy port}}"

(…but replace the {{proxy}} and {{proxy port}} placeholders with your actual values.)

I know this doesn’t have anything to do with the validator badge, but it was a stumbling block for me getting it up and running (albeit with no previous maven experience at all) so I wanted to share it.