mnahkies / openapi-code-generator

A code generation tool for openapi 3 / 3.1 specifications written in typescript, primarily aimed at generating typescript clients and server stubs. Other target languages may be added in future.
https://openapi-code-generator.nahkies.co.nz/
MIT License
20 stars 2 forks source link

OpenAPI 3.1.x schemas falsely fail validation with ajv #103

Open mnahkies opened 11 months ago

mnahkies commented 11 months ago

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.