CodeDredd / pinia-orm

The Pinia plugin to enable Object-Relational Mapping access to the Pinia Store.
https://pinia-orm.codedredd.de/
MIT License
452 stars 39 forks source link

Support for auto-generating models based on Swagger / OpenAPI Specifications #1780

Open JeffJassky opened 9 months ago

JeffJassky commented 9 months ago

Describe the feature

pinia-orm is a perfect candidate for supporting Swagger / OpenAPI spec for schemas.

Considering that schemas and API paths are well-defined in an OpenAPI spec file (yml, or json), it wouldn't be too difficult have a builder that would auto-generate ORM models, and even axios requests, along with validation of the request bodies and response bodies, based on the OpenAPI/Swagger spec - all with full typescript support.

I wrote a Vite plugin for my monorepo builds all of the above based on my apo spec file, plus it builds the express routes, zod/yup schemas, mongoose schemas. However, my system currently lacks support for client-side ORM.

I am considering wrting an additional builder for pinia-orm models - however, i'll have to do some testing with it to ensure pinia-orm is a good solution for my app before i commit to building a code generator, and wanted to drop the idea in here in the meantime.

Additional information

Final checks

CodeDredd commented 6 months ago

That sounds nice. It's always nice to have some tool more in the ecosystem.