Skip to content

NodeJS library that generates Typescript or Javascript clients based on the OpenAPI specification

License

Notifications You must be signed in to change notification settings

yobta/generator

Repository files navigation

SDK Generator

Node.js library that generates React/Nextjs/Swr/Typescript SDK based on the OpenAPI specification.

Install

pnpm i @yobta/generator

Usage

$ generate-yobta --help

  Usage: generate-yobta [options]

  Options:
    -V, --version             output the version number
    -i, --input <value>       OpenAPI specification, can be a path, url or string content (required)
    -o, --output <value>      Output directory (required)
    -f, --factories <value>   Path to file with factories functions (required)
    --useUnionTypes <value>   Use union types instead of enums (default: true)
    --exportSchemas <value>   Write schemas to disk (default: false)
    --indent <value>          Indentation options [4, 2, tab] (default: "4")
    --postfixModels           Model name postfix
    -h, --help                display help for command

  Examples
    $ generate-yobta --input ./spec.json --output ./generated --factories ./src/factories

Documentation

Support

Credits

This repository is a standalone fork of openapi-typescript-codegen. While it retains the same schema parsing mechanisms, it generates a distinct client that features fetch, split server/client queries, and SWR support.

About

NodeJS library that generates Typescript or Javascript clients based on the OpenAPI specification

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published