JSPM

  • Created
  • Published
  • Downloads 22355
  • Score
    100M100P100Q136320F
  • License MIT

Convert OpenAPI 3.0 or Swagger 2.0 definitions into aspida

Package Exports

  • openapi2aspida

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (openapi2aspida) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

OpenAPI or Swagger to aspida

aspida aspida-mock openapi2aspida pathpida @aspida/axios @aspida/ky @aspida/fetch





aspida




Convert OpenAPI 3.0 or Swagger 2.0 definitions into aspida.



Getting Started

Create config file in project root

aspida.config.js

module.exports = {
  input: "apis", // "input" of aspida is "output" for openapi2aspida
  openapi: { inputFile: "https://petstore.swagger.io/v2/swagger.json" } // Compatible with yaml/json of OpenAPI3.0/Swagger2.0
}

aspida.config.js (enable aspida-mock)

module.exports = {
  input: "apis",
  openapi: { inputFile: "https://petstore.swagger.io/v2/swagger.json", mock: true }
}

tarminal

$ npx openapi2aspida --build
# apis/$api.ts was built successfully.
# (apis/$mock.ts was built successfully.)

License

openapi2aspida is licensed under a MIT License.