sellersindustry / SherpaJS

Agnostic and Modular Serverless Web Framework. Build and modularize custom API endpoints, inspired by NextJS APIs. Export to Vercel and Local.
https://docs.page/sellersindustry/SherpaJS
MIT License
13 stars 1 forks source link

Auto Generate Client Code #112

Open SellersEvan opened 4 months ago

SellersEvan commented 4 months ago

Is your feature request related to a problem? Please describe. Auto-generate client code and OpenAPI documents from your APIs.

Describe the solution you'd like Add JS doc comments above your endpoints to generate client functions in different languages.

import foo from "..."

/** Title
 * Description
 * @method getPost
 * @paramater param1 {int} - description
 * @paramater param2 {?foo} - description
* The above helps build the function ... other OpenAPI props here optional
*/
export function POST<requestSchema, responseSchema>() {
    return Response.JSON({
        "string": "food",
        "number": 3,
        "boolean": true,
        "object": {
            "numbers": [3, -4]
        }
    });
}

Describe alternatives you've considered N/A

Additional context