@financialforcedev/orizuru-openapi
Version:
OpenAPI generator for Orizuru.
513 lines (133 loc) • 5.79 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Module: lib/openapigenerator</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Module: lib/openapigenerator</h1>
<section>
<header>
</header>
<article>
<div class="container-overview">
<div class="description">OpenAPI Generator.</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="openapigenerator.js.html">openapigenerator.js</a>, <a href="openapigenerator.js.html#line206">line 206</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id=".generateV2"><span class="type-signature">(static) </span>generateV2<span class="signature">(template, schemas)</span><span class="type-signature"> → {RequestHandler}</span></h4>
<div class="description">
Returns an express RequestHandler function that will send an OpenAPI 2.0 document
as a JSON response. The template is merged with the paths and definitions
generated from the Avro schema map.
A generated response definition is created with the name 'Response' this must
not clash with any schemas passed in.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>template</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last">The OpenAPI 2.0 template.</td>
</tr>
<tr>
<td class="name"><code>schemas</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last">Map of name to Avro schema JSON object.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="openapigenerator.js.html">openapigenerator.js</a>, <a href="openapigenerator.js.html#line233">line 233</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
- The handler.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">RequestHandler</span>
</dd>
</dl>
<h3 class="subsection-title">Type Definitions</h3>
<h4 class="name" id="~RequestHandler"><span class="type-signature"></span>RequestHandler<span class="signature">(req, res)</span><span class="type-signature"></span></h4>
<div class="description">
An express request handler.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>req</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">The request.</td>
</tr>
<tr>
<td class="name"><code>res</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">The response.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="openapigenerator.js.html">openapigenerator.js</a>, <a href="openapigenerator.js.html#line213">line 213</a>
</li></ul></dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-lib_index.html">lib/index</a></li><li><a href="module-lib_openapigenerator.html">lib/openapigenerator</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Oct 13 2017 13:50:50 GMT+0100 (BST)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>