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 |
---|
Convert OpenAPI 3.0 or Swagger 2.0 definitions into aspida.
Getting Started
Installation
Using npm:
$ npm install @aspida/axios // @aspida/ky or @ aspida/fetch $ npm install openapi2aspida --save-dev
Using Yarn:
$ yarn add @aspida/axios // @aspida/ky or @ aspida/fetch $ yarn add openapi2aspida --dev
Using npm with aspida-mock:
$ npm install @aspida/axios $ npm install openapi2aspida aspida-mock --save-dev
Make HTTP request from application
aspida.config.js
module.exports = {
input: "apis", // "input" of aspida is "output" for openapi2aspida
openapi: { inputFile: "assets/openapi.json" } // Compatible with yaml/json of OpenAPI3.0/Swagger2.0
}
aspida.config.js
(enable mock)
module.exports = {
input: "apis",
openapi: { inputFile: "assets/openapi.json", mock: true }
}
package.json
{
"scripts": {
"build:openapi": "openapi2aspida --build"
}
}
tarminal
$ npm run build:openapi
# apis/$api.ts was built successfully.
# (apis/$mock.ts was built successfully.)
License
openapi2aspida is licensed under a MIT License.