@dhcode/openapi-viewer
TypeScript icon, indicating that this package has built-in type declarations

0.2.2 • Public • Published

OpenAPI Viewer Angular Component Library

npm

This Angular library contains components to show API documentation based on Swagger v2 and OpenAPI v3 RESTful API specifications.

This UI is inspired by the Swagger UI project, but is more focused on doing API requests.

Demo

Usage

The Angular CDK is required as a peer dependency.

npm install @angular/cdk
npm install @dhcode/openapi-viewer

Add the OpenapiViewerModule to your module imports.

Add the oav-openapi-viewer component to your template.

<oav-openapi-viewer specUrl="https://petstore.swagger.io/v2/swagger.json">

You can use any Swagger v2 json file or OpenAPI v3 json or yaml file to load a specification.

Provide configuration

To supply custom settings, you can provide them in your module providers.

{
  provide: OavSettings,
  useValue: new OavSettings({
    showRawOperationDefinition: true,
    showRawModelDefinition: true
  })
}

License

MIT

Package Sidebar

Install

npm i @dhcode/openapi-viewer

Weekly Downloads

11

Version

0.2.2

License

MIT

Unpacked Size

1.65 MB

Total Files

92

Last publish

Collaborators

  • dhcode