Giter Site home page Giter Site logo

openapi-parser-shark's Introduction

OPENAPI-PARSESR

introduction

generate service code according to OpenAPI document,support openapi 2.0 and openapi 3.0

Emmmmm

  • typescript.auto generate data model from openapi schema.
  • flexibility.organize your code by specifying tag.

what's tag

image image image

installation

npm install openapi-parser-shark

usage

npx openapi-parser -h
Usage: openapi-parser [options]

openapi-parser

Options:
-c, --configFilePath <configFilePath> read configuration file to generate service file
-s, --src <src> the url(path) to get openapi-json,from local disk、https or http resource <src>
-d, --dest <dest> the folder that parser generated the file to,default to be the current path<dest>
-n, --name <name> file name,default to be [api].ts<name>
-t, --tags <tags> specify tags,default to be empty and create full service code<name>
-h, --help display help for command

type declaration

the content of configFile follow the below data structure

interface ConfigType {
  url: string
  outputPath?: string
  serviceImportPath?: string
  apis: {
    tags: string[]
    serviceName: string
  }[]
}

demo

use configFile

config.json

{
  "url": "http://api-center.net/v2/api-docs/xx-service",
  "serviceImportPath": "./service",
  "outputPath": "output",
  "apis": [
    {
      "tags": ["aaaa", "bbbb"],
      "serviceName": "aaaBbbApi"
    }
  ]
}

run command

npx openapi-parser -c config.json

use command option totally

 npx openapi-parser -s http://api-center.net/v2/api-docs/xx-service -n aaaBbbApi -d output -t aaaa,bbbb

openapi-parser-shark's People

Watchers

corianderHunter avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.