fastify-openapi-connector-generator
TypeScript icon, indicating that this package has built-in type declarations

1.1.2 • Public • Published

Fastify OpenAPI Connector Generator

Companion package to fastify-openapi-connector usable both programatically and with npx.

fastify-openapi-connector is minimum dependency package, therefore generator has been split into it's own (this) package.

Usage

Use npx:

npx fastify-openapi-generator <options>

Or import the generator usual way and programatically, everything is exported so you can also just pick bits and pieces.

Options

Required

  • --schema-file
    • Path to schema file generated by openapi-typescript.
  • --types-file
    • Path to where types file should be generated.
  • --service-file
    • Path to where service file should be generated.
  • --spec-file
    • Path to OpenAPI spec file

Optional

  • --help
    • Display this
  • --paths-dir
    • Directory to generate route handlers from paths section of OAS.
  • --webhooks-dir
    • Directory to generate route handlers from webhooks section of OAS.
  • --security-dir
    • Directory to generate security handlers.
  • --untyped
    • Indicates that generated handlers should be untyped.
  • --override-types-file
    • Indicates that types file should be overrided if exists.

Example

npx fastify-openapi-connector-generator \
  --schema-file=./src/generated/schema.ts \
  --types-file=./src/generated/types.ts \
  --service-file=./src/generated/service.ts \
  --paths-dir=./src/paths \
  --webhooks-dir=./src/webhooks \
  --security-dir=./src/security \
  --spec-file=./spec.yaml \
  --override-types-file

Package Sidebar

Install

npm i fastify-openapi-connector-generator

Weekly Downloads

93

Version

1.1.2

License

MIT

Unpacked Size

31.1 kB

Total Files

10

Last publish

Collaborators

  • ste.martinek