swagger-api / swagger-api/validator-badge
Validator throws error for external references
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 227
- Forks
- 81
- Avg merge
- 2h 3m
- Merged PRs (30d)
- 1
Description
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.
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
Reproduce the validator-badge failure with the Swagger file and the external common/schema/car.schema reference shown in the report. Compare its handling with Swagger Editor and SwaggerUI, then verify that valid external references are accepted and that malformed or unreadable inputs still produce useful validation details.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100