mnahkies / mnahkies/openapi-code-generator

OpenAPI 3.1.x schemas falsely fail validation with ajv

Open
#103 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug openapi31
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:

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.