Skip to content

zdminjs/ara

Repository files navigation

@zdmin/ara Ask DeepWiki

English | 简体中文

Generate Request Code from OpenAPI specs in seconds

TS/JS Code Gen

  • ​​TypeScript / JavaScript Code Supported
  • Type Safety​​ for Both TypeScript / JavaScript (by JSDoc)
  • Swagger 2.0 / OpenAPI 3.0 specs Supported
  • Chrome Extension for UI & Preview
  • ​​Vite / Webpack Supported (Compat with Vite 2.x / Webpack 3.x)
  • Node 14+ Supported

usage

1. Setup Project

install: pnpm install -D @zdmin/ara-unplugin

Vite
import { defineConfig } from 'vite'
import Ara from '@zdmin/ara-unplugin/vite'

// https://vite.dev/config/
export default defineConfig({
  plugins: [
    Ara({
      doc: 'https://petstore.swagger.io/'
    }),
    // ...
  ],
  // ...
})
Webpack
import Ara from '@zdmin/ara-unplugin/webpack'
// const Ara = require('@zdmin/ara-unplugin/webpack')

export default {
  plugins: [
    Ara({
      doc: 'https://petstore.swagger.io/'
    }),
    // ...
  ],
  // ...
};

for other client project: build your own server like local-server

2. Download & Install Chrome Extension

Why use Chrome Extension?

Since openapi docs behind some auth in common, we use Chrome Extension for getting openapi docs data seamlessly.

3. Preview & Generate

  • Open Chrome DevTools
  • Visit OpenAPI doc page
  • Preview & Generate Code

Preview & Generate Code in Chrome DevTools

About

Improve DX of API integration to next level

Resources

Contributing

Stars

Watchers

Forks

Packages

No packages published