swagger-api / validator-badge

Validate your Swagger JSON/YAML today!
http://swagger.io
Apache License 2.0
210 stars 85 forks source link

Decode paths in error messages #88

Open DavidBiesack opened 8 years ago

DavidBiesack commented 8 years ago

The tool is very useful and less cryptic than json-schema-validator alone, but it would be nice if the tool "decoded" the more cryptic pointer embedded in error messages.

For example given the error response

{"loadingURI":"http://swagger.io/v2/schema.json#","pointer":"/definitions/responseValue"},"instance":{"pointer":"/paths/~1reports~1{reportId}~1content~1elements/get/responses/200"}}]

it would be nice if the validator "decoded' the pointer -- especially the ~1 encoding of slashes in the paths -- to and showed the path structure:

paths:
      "/reports/{reportid}/content/elements":
          get:
                responses: 
                     '200'

This would make it much easier to locate the source of the error in the input Swagger document.