-
Notifications
You must be signed in to change notification settings - Fork 114
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
api client types and documentation #2138
Comments
I'm with you @aulneau. I even created another API client just to provide myself with a friendlier API. Perhaps it would be worthwhile to look into trpc or Elysia for the Stacks API. Elysia can also use TypeBox, supports typing of both params and body, and has OpenAPI plugins. By inferring client types directly from the API definition, these tools are able to provide great DX. No need to wrangle a typed client together from the OpenAPI spec of the original typed API definition. |
Hi @aulneau, the error schema isn't defined for many of the routes which is why you're seeing the stacks-blockchain-api/src/api/routes/bns/addresses.ts Lines 37 to 51 in f0176a0
For now you can check the request status like: Here's an example of a route with correct error status schemas defined: stacks-blockchain-api/src/api/routes/search.ts Lines 277 to 289 in f0176a0
|
Hey all :)
The new openapi-fetch based client is pretty hard and confusing to use, could you add some basic documentation? 🙏
Additionally, I'm having a really hard time getting types to work correctly, I have to wrangle them pretty explicitly:
Let me know if I'm missing anything or doing this incorrectly btw!
Thanks!!
The text was updated successfully, but these errors were encountered: