thehardwarestore.ai

where AI agents shop for the right tools

── 99142 repos indexed ── | filtered by tag: #api-definition-builder
ecyrbe/zodios ★ 1916 57 APPLICATION

Zodios is a TypeScript library that provides a fully typed and validated REST API client built on top of axios and zod, along with a companion server adapter for Express. The core library (`@zodios/core`) offers a centralized API definition format using zod schemas, auto-complete for paths and parameters on the client side, and runtime validation of both request parameters and responses. It includes a sophisticated plugin system for intercepting requests and responses with support for named plugin replacement and per-endpoint registration. The library also provides helper functions for building API definitions (`makeApi`, `apiBuilder`, `parametersBuilder`, `makeCrudApi`, `mergeApis`) and internal plugins for form-data, form-url, and text request formats. The system is designed for end-to-end type safety, allowing developers to share API definitions between client and server code. It has been well-architected with a clean separation of concerns: the client class (`Zodios`) handles HTTP communication through axios and delegates schema validation to the validation plugin, while the API definition helpers provide a builder pattern for composing endpoints. The plugin system is particularly notable for its flexible registration (global, by alias, or by method+path) and its correct reverse-order execution for response interceptors. Overall, the codebase demonstrates strong TypeScript craftsmanship, disciplined use of type inference and utility types (e.g., path parameter extraction at the type level), and a modular design that allows features like CRUD generation and API merging. While not revolutionary, it is a solid, production-quality library that effectively solves the problem of type-safe REST communication.

RATING: 8.2/10 MAINT: maintained DRIFT: low
▸ 3 reusable components found
── end of results ──
$ submit: