Skip to content

Latest commit

 

History

History
36 lines (25 loc) · 839 Bytes

README.md

File metadata and controls

36 lines (25 loc) · 839 Bytes

API Code Generator

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.

Getting Started

  1. Provide your API details in api.yaml file

Format

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)
  1. Run the script
npm install
npm run build
  1. Check your /api folder for the code.