autogen api service to swr hooks ideas #1002
Replies: 3 comments
-
Love the idea! It can be a plugin of the backend framework indeed, and it will work well in a monolithic codebase. Related: https://twitter.com/rauchg/status/1368283797280550912. |
Beta Was this translation helpful? Give feedback.
-
I know this is an older post, but just for everyone who stumbles upon this, there is a project that does exactly this: https://orval.dev/ - Not exclusively for, but including swr. Console output is not perfect - if there is something wrong with the specs, it takes a bit of time to figure out how to fix it, but apart from this, it's working pretty well for me. |
Beta Was this translation helpful? Give feedback.
-
I have a tool for generating openapi swagger doc to swr, used it for several years, can have a try... |
Beta Was this translation helpful? Give feedback.
-
I am curious if you have ever considered doing something with swr similar to how rtk query creates api services: https://rtk-query-docs.netlify.app/introduction/getting-started/#create-an-api-service
I am trying to imagine how to do something where there is a workflow for swagger/oas spec all the way to the swr hook.
OpenAPI Generator ->
https://github.com/OpenAPITools/openapi-generator#overview
Something like:
Beta Was this translation helpful? Give feedback.
All reactions