0.2.2 • Published 3 years ago

@dhcode/openapi-viewer v0.2.2

Weekly downloads
3
License
MIT
Repository
github
Last release
3 years ago

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