This project is built to automate the process of creating API client and functions to call to our endpoints. The idea is to provide a list of endpoints and metadata, run a script and generate files that contains all the functions needed to fetch data through the API.
- Provide your API details in
api.yaml
file
name: API name
base_url: Base Endpoint
# A list of endpoints
endpoints:
- resource:
GET /resource:
# metadata (summary, data type)
# {id} is a placeholder for your parameter
GET /resource/{id}:
# metadata (summary, data type)
POST /resource:
# metadata (summary, data type)
- Run the script
npm install
npm run build
- Check your
/api
folder for the code.