RESTyped Aims to Help Bridge the Gap Between API server and Clients

Arman Dezfuli-Arjomandi, a designer, developer, and creator of Falcross, has launched RESTyped, a specification for end-to-end typing for REST APIs with TypeScript. RESTyped was created to bridge the gap between an API server and clients. It does this by providing developers an easy way to share API request and response types between a public or private client and an API server.

According to the documentation, among the benefits of using RESTyped are that it works with any REST API, supports any server framework or REST client, and is lightweight. API definitions do not require shipping an API wrapper with a lot of generated code. RESTyped is based on TypeScript, and it takes advantage of TypeScript's keyof/Lookup Types, Parameter Defaults, and generic inference. The RESTyped editor auto-suggests routes that are available within an API, type checks query params, and automatically types the res.data object.

Dezfuli-Arjomandi says in the announcement post that "When you consume an API with a RESTyped definition, you'll save time jumping back and forth between docs and code, and reduce bugs in the process. It's an easier, safer way to consume APIs."

At this time, server and client packages are available on GitHub; restyped-axios and restyped-express-async. These packages are to be used along with a RESTyped definition file. Restyped-axios is a client wrapper to consume RESTyped APIs, and restyped-express-async is the server wrapper for delivering RESTyped APIs. RESTyped requires TypeScript 2.4+.

For more information about RESTyped, read the announcement on the Falcross blog or the documentation on GitHub.

Be sure to read the next API Description Languages article: It's Time For Every API to Have an OpenAPI Spec

 

Comments (0)