Closed
Description
Problem statement
swagger validate
produces some pretty unhelpful error messages, such as object has no key ""
for the following incomplete swagger spec.
Contrast with an online Swagger validator like http://bigstickcarpet.com/swagger-parser/www/index.html (based on https://github.com/BigstickCarpet/swagger-parser) which specifically calls out:
Error resolving $ref pointer "#/responses/".
Token "responses" does not exist.
Much more helpful.
Swagger specification
{
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"schemes": [
"http"
],
"swagger": "2.0",
"info": {
"description": "description",
"title": "title",
"version": "1.0"
},
"host": "localhost",
"basePath": "/",
"paths": {
"/v1/authenticate": {
"get": {
"summary": "Authenticate with a token (JWT).",
"operationId": "authHandler",
"responses": {
"200": {
"$ref": "#/responses/"
}
}
}
}
},
"definitions": {}
}
Steps to reproduce
❯ swagger validate swagger.json
The swagger spec at "swagger.json" is invalid against swagger specification 2.0. see errors :
- object has no key ""