respec-oas is a ReSpec plugin that integrates OpenAPI Specification (OAS) data directly into ReSpec specifications. It enables dynamic rendering of API summaries, endpoint details, request/response schemas, and expected caller information using OpenAPI YAML files.
- ✅ Validates multiple OpenAPI YAML documents
- 📄 Renders:
- API summary tables
- Endpoint-level details
- JSON Schema request/response formats
To include respec-oas
in your ReSpec-based document, add the following
to your HTML:
<script class="remove"
src="https://cdn.jsdelivr.net/gh/digitalbazaar/[email protected]/dist/main.js">
</script>
Add these classes to <table>
or <section>
elements:
<table class="api-summary-table" data-api-path="/example-path /another-path"></table>
<table class="api-component-table" data-api-path="/example-path"></table>
<section class="api-detail" data-api-endpoint="post /example-path"></section>
Ensure your document or script environment has access to respec-oas
. For example:
<script class="remove"
src="https://cdn.jsdelivr.net/gh/digitalbazaar/[email protected]/dist/main.js">
</script>
and then call it from the respec configuration in a post-processing step:
postProcess: [window.respecOas.injectOas],