swagger-api / swagger-api/validator-badge
Decode paths in error messages
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 227
- Forks
- 81
- Avg merge
- 2h 3m
- Merged PRs (30d)
- 1
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how validator errors are formatted and where the instance pointer from the example is handled. Use the reported Swagger response to determine how JSON Pointer escaping such as ~1 should be decoded and represented as a readable path structure. Done means error messages show the decoded path clearly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100