Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/readmeio/api

🚀 Automatic SDK generation from an OpenAPI definition
https://github.com/readmeio/api

api openapi sdk swagger

Last synced: 2 days ago
JSON representation

🚀 Automatic SDK generation from an OpenAPI definition

Awesome Lists containing this project

README

        




Magical SDK generation from an OpenAPI definition 🪄


NPM Version
Node Version
MIT License
Build status

- [Installation](https://api.readme.dev/docs/installation)
- [Usage](https://api.readme.dev/docs/usage)
- [Authentication](https://api.readme.dev/docs/authentication)
- [Parameters and Payloads](https://api.readme.dev/docs/parameters-and-payloads)
- [Making requests](https://api.readme.dev/docs/making-requests)
- [Server configurations](https://api.readme.dev/docs/server-configurations)
- [How does it work?](https://api.readme.dev/docs/how-it-works)
- [FAQ](https://api.readme.dev/docs/faq)

`api` is a library that facilitates creating an SDK from an OpenAPI definition. You can use its codegen offering to create an opinionated SDK for TypeScript or JS (+ TypeScript types).

```sh
$ npx api install https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/examples/v3.0/petstore.json
```

```js
const petstore = require('@api/petstore');

petstore.listPets().then(({ data }) => {
console.log(`My pets name is ${data[0].name}!`);
});
```

The ESM syntax is supported as well:

```js
import petstore from '@api/petstore';

petstore.listPets().then(({ data }) => {
console.log(`My pets name is ${data[0].name}!`);
});
```