@dhcode/openapi-viewer
v0.2.2
Published
Angular Library to display Swagger and OpenAPI RESTful API specifications.
Downloads
19
Maintainers
Readme
OpenAPI Viewer Angular Component Library
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.
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
})
}