@financialforcedev/orizuru-openapi
Version:
OpenAPI generator for Orizuru.
99 lines (60 loc) • 2.95 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Home</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">Home</h1>
<h3> </h3>
<section>
<article><h1>Orizuru OpenAPI schema generator</h1><p><a href="https://nodesecurity.io/orgs/ffres/projects/178e230f-bb6f-4032-8343-fddec5b92397"><img src="https://nodesecurity.io/orgs/ffres/projects/178e230f-bb6f-4032-8343-fddec5b92397/badge" alt="NSP Status"></a></p>
<p>Orizuru OpenAPI generator is a module that can generate an OpenAPI document from a map of service name to <a href="https://avro.apache.org/">Avro</a> schemas. Each schema represents an input event that is exposed as a <strong>POST</strong> path, within the OpenAPI definition.</p>
<p>Currently <a href="https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md">OpenAPI version 2.0</a> documents are generated. </p>
<h2>Install</h2><pre class="prettyprint source"><code>$ npm install @financialforcedev/orizuru-openapi</code></pre><h3>Usage</h3><pre class="prettyprint source lang-javascript"><code>
const
openapiGenerator = require('@financialforcedev/orizuru-openapi').generator;
schemaMap = {
'question': require('./question')
};
app.get('/openapi/v2', openapiGenerator.generateV2({
info: {
version: '1.0.0',
title: 'Test',
description: 'My description'
},
host: 'localhost:3000',
basePath: '/api',
schemes: ['http']
}, schemaMap));</code></pre><h2>Response schema</h2><p>The Orizuru project is aimed at asynchronous use cases, so the response schema is always a simple id string.</p>
<pre class="prettyprint source lang-javascript"><code>
schema: {
type: 'object',
required: ['id'],
properties: {
id: {
type: 'string'
}
}
}</code></pre><h2>API Docs</h2><p>Click to view <a href="http://htmlpreview.github.io/?https://github.com/financialforcedev/orizuru-openapi/blob/master/doc/index.html">JSDoc API documentation</a>.</p></article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-index.html">index</a></li><li><a href="module-openapigenerator.html">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 Thu Oct 26 2017 14:10:25 GMT+0100 (BST)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>