mnahkies / mnahkies/openapi-code-generator
OpenAPI 3.1.x schemas falsely fail validation with ajv
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 34
- Forks
- 8
- Avg merge
- 20h 27m
- Merged PRs (30d)
- 7
Description
Expected Behavior
A valid openapi: "3.1.0" document should pass initial validation against the openapi 3.1 specification without errors.
Actual Behavior
Validation fails with confusing / obtuse error messages.
Cause
It seems that ajv does not support some of the keywords used in defining the specification properly, causing it to fail:
- https://github.com/OAI/OpenAPI-Specification/issues/2689
- https://github.com/ajv-validator/ajv/issues/1745
The best thing to do is probably wait for ajv to improve support for $dynamicAnchor, and skip validation for 3.1 specifications in the meantime.
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 locating the initial OpenAPI validation path and reproducing the failure with a valid openapi: "3.1.0" document. Inspect how ajv handles the 3.1 specification and its $dynamicAnchor keywords; done means valid OpenAPI 3.1 documents pass initial validation without confusing errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi, typescript
- Domain
- api, devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100