hey-api / openapi-ts

🚀 The OpenAPI to TypeScript codegen. Generate clients, SDKs, validators, and more. Support: @mrlubos
https://heyapi.dev
Other
1.37k stars 106 forks source link

Ensuring using generated schema's with AJV #1118

Open robogeek opened 1 month ago

robogeek commented 1 month ago

Description

AJV is an excellent way to generate data validation code starting from JSON Schema's. OpenAPI specifications build on JSON Schema's. The openapi-ts project can generate JSON Schema's from OpenAPI specs. To close the loop, the task is to ensure those schema's are usable by AJV.

The goal is similar to the Zod request -- https://github.com/hey-api/openapi-ts/issues/876 -- Which is autogeneration of data validation from an OpenAPI spec.

It seems to me AJV is a more direct ask since OpenAPI is so close to JSON Schema.

mrlubos commented 1 month ago

Yep. Duplicate of https://github.com/hey-api/openapi-ts/issues/458 I believe