@dhcode/openapi-viewer

Angular Library to display Swagger and OpenAPI RESTful API specifications.

Usage no npm install needed!

<script type="module">
  import dhcodeOpenapiViewer from 'https://cdn.skypack.dev/@dhcode/openapi-viewer';
</script>

README

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