Skip to content

kagawagao/opas

Repository files navigation

OPAS

Open API toolkit for TS/JS

build CodeQL

Features

  • Generate API definitions from OpenAPI 2/3 spec
  • Generate API docs from OpenAPI 2/3 spec
  • Generate API client from OpenAPI 2/3 spec
  • Generate API SDK from OpenAPI 2/3 spec
  • Generate UI from OpenAPI 2/3 spec

Fundamentals

Core packages

Plugins

Usage

Install

npm install @opas/core

Example

import { OpenAPIRunner } from '@opas/core'
import OpenAPITransformDefinitionPlugin from '@opas/plugin-definition'

await OpenAPIRunner.run([
  {
    url: `your open api spec url or file path`,
    namespace: `your namespace`,
    plugins: [
      new OpenAPITransformDefinitionPlugin({
        outputDir: `your output dir`,
      }),
    ],
  },
])

More examples can be found in the test directory of each plugin