-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature(farrow-restapi): combine request schema and response schema to be api schema. #19
Comments
Would this allow to use a typed API client on a frontend project that's separate from the backend? Like a create-react-app project. I'm currently achieving this using Express and customized versions of the packages in https://github.com/rawrmaan/restyped. I leverage yarn workspaces to import the backend workspace (which exports an API typescript interface) from the frontend workspace. It works great, but it feels a little hacky in some places. I can give a more in-depth explanation on the whole setup if needed. I'm really liking what I have seen from Farrow thus far, so I'd like to consider it for future projects! |
Yes, that is the goal. It will provide at least three ways to share the server-side schema/type with the client-side
|
Prisma's introspect has a very good experience We can try to use the |
@uinz Good point! Thanks for sharing! |
For now,
farrow-http
just supporting the request schema.We can use
farrow-schema
to describe the request and response of all the RESTFul API and integrate it with something likeoepnapi
. And seamless reusing the schema/type of all Apis in client-side for implementing type-safe fetcher.The server-side
The client-side
The schema of API can generate an API client for client-side
The text was updated successfully, but these errors were encountered: