api-render-ui
v1.1.0
Published
api-render-ui is a UI library that pursues simple and efficient data rendering for openapi.
Maintainers
Readme
api-render-ui is a UI library that pursues simple and efficient data rendering for openapi.
Table of contents
[![NPM Version][npm-version-image]][npm-url] [![NPM Downloads][npm-downloads-image]][npm-downloads-url] [![OpenSSF Scorecard Badge][ossf-scorecard-badge]][ossf-scorecard-visualizer]
Usage in typescript project
- Please install first
npm install api-render-ui- Define a container id in the html
<div id="notebook" style="overflow-y: auto;align-self: stretch;align-items: center;flex: 1 1 0;"></div>- Your typescript code
import { ApiRenderer } from "api-render-ui"
const apiRenderer = new ApiRenderer({
mountPoint: '#notebook', // 可以是选择器字符串
});
// 执行渲染
apiRenderer.render(openapiSpec);Usage in single html
Please refer to example in the source code.
Installation
This is a Node.js module available through the npm registry.
Before installing, download and install Node.js. Node.js 18 or higher is required.
If this is a brand new project, make sure to create a package.json first with
the npm init command.
Installation is done using the
npm install command:
npm install api-render-uiFeatures
- convert openapi spec data to api list.Only openapi 3.0+ is supported now.
- Api unit UI.
