Skip to content

digitalbazaar/respec-oas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

respec-oas

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.

Features

  • ✅ Validates multiple OpenAPI YAML documents
  • 📄 Renders:
    • API summary tables
    • Endpoint-level details
    • JSON Schema request/response formats

Installation

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>

Usage

1. Define Tables and Sections in Your HTML

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>

2. Load respec-oas

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],

About

Open API Specification extensions to ReSpec.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •