Files
shields/module-core_base-service_openapi.html
2024-01-13 18:30:54 +00:00

1642 lines
30 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Module: core/base-service/openapi</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: core/base-service/openapi</h1>
<section>
<header>
</header>
<article>
<div class="container-overview">
<div class="description"><p>Functions for publishing the shields.io URL schema as an OpenAPI Document</p></div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="core_base-service_openapi.js.html">core/base-service/openapi.js</a>, <a href="core_base-service_openapi.js.html#line1">line 1</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="~pathParam"><span class="type-signature">(inner) </span>pathParam<span class="signature">(param)</span><span class="type-signature"> &rarr; {<a href="module-core_base-service_openapi.html#~OpenApiParam">module:core/base-service/openapi~OpenApiParam</a>}</span></h4>
<div class="description">
<p>Helper function for assembling an OpenAPI path parameter object</p>
</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>param</code></td>
<td class="type">
<span class="param-type"><a href="module-core_base-service_openapi.html#~PathParamInput">module:core/base-service/openapi~PathParamInput</a></span>
</td>
<td class="description last"><p>Input param</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="core_base-service_openapi.js.html">core/base-service/openapi.js</a>, <a href="core_base-service_openapi.js.html#line356">line 356</a>
</li></ul></dd>
<dt class="tag-see">See:</dt>
<dd class="tag-see">
<ul>
<li><a href="https://swagger.io/specification/#parameter-object">https://swagger.io/specification/#parameter-object</a></li>
</ul>
</dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>OpenAPI Parameter Object</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="module-core_base-service_openapi.html#~OpenApiParam">module:core/base-service/openapi~OpenApiParam</a></span>
</dd>
</dl>
<h4 class="name" id="~pathParams"><span class="type-signature">(inner) </span>pathParams<span class="signature">(&hellip;params)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="module-core_base-service_openapi.html#~OpenApiParam">module:core/base-service/openapi~OpenApiParam</a>>}</span></h4>
<div class="description">
<p>Helper function for assembling an array of OpenAPI path parameter objects
The code</p>
<pre class="prettyprint source"><code>const params = pathParams(
{ name: 'name1', example: 'example1' },
{ name: 'name2', example: 'example2' },
)
</code></pre>
<p>is equivalent to</p>
<pre class="prettyprint source"><code>const params = [
pathParam({ name: 'name1', example: 'example1' }),
pathParam({ name: 'name2', example: 'example2' }),
]
</code></pre>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>params</code></td>
<td class="type">
<span class="param-type"><a href="module-core_base-service_openapi.html#~PathParamInput">module:core/base-service/openapi~PathParamInput</a></span>
</td>
<td class="attributes">
&lt;repeatable><br>
</td>
<td class="description last"><p>Input params</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="core_base-service_openapi.js.html">core/base-service/openapi.js</a>, <a href="core_base-service_openapi.js.html#line386">line 386</a>
</li></ul></dd>
<dt class="tag-see">See:</dt>
<dd class="tag-see">
<ul>
<li><a href="module-core_base-service_openapi.html#~pathParam">module:core/base-service/openapi~pathParam</a></li>
</ul>
</dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Array of OpenAPI Parameter Objects</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Array.&lt;<a href="module-core_base-service_openapi.html#~OpenApiParam">module:core/base-service/openapi~OpenApiParam</a>></span>
</dd>
</dl>
<h4 class="name" id="~queryParam"><span class="type-signature">(inner) </span>queryParam<span class="signature">(param)</span><span class="type-signature"> &rarr; {<a href="module-core_base-service_openapi.html#~OpenApiParam">module:core/base-service/openapi~OpenApiParam</a>}</span></h4>
<div class="description">
<p>Helper function for assembling an OpenAPI query parameter object</p>
</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>param</code></td>
<td class="type">
<span class="param-type"><a href="module-core_base-service_openapi.html#~QueryParamInput">module:core/base-service/openapi~QueryParamInput</a></span>
</td>
<td class="description last"><p>Input param</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="core_base-service_openapi.js.html">core/base-service/openapi.js</a>, <a href="core_base-service_openapi.js.html#line397">line 397</a>
</li></ul></dd>
<dt class="tag-see">See:</dt>
<dd class="tag-see">
<ul>
<li><a href="https://swagger.io/specification/#parameter-object">https://swagger.io/specification/#parameter-object</a></li>
</ul>
</dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>OpenAPI Parameter Object</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="module-core_base-service_openapi.html#~OpenApiParam">module:core/base-service/openapi~OpenApiParam</a></span>
</dd>
</dl>
<h4 class="name" id="~queryParams"><span class="type-signature">(inner) </span>queryParams<span class="signature">(&hellip;params)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="module-core_base-service_openapi.html#~OpenApiParam">module:core/base-service/openapi~OpenApiParam</a>>}</span></h4>
<div class="description">
<p>Helper function for assembling an array of OpenAPI query parameter objects
The code</p>
<pre class="prettyprint source"><code>const params = queryParams(
{ name: 'name1', example: 'example1' },
{ name: 'name2', example: 'example2' },
)
</code></pre>
<p>is equivalent to</p>
<pre class="prettyprint source"><code>const params = [
queryParam({ name: 'name1', example: 'example1' }),
queryParam({ name: 'name2', example: 'example2' }),
]
</code></pre>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>params</code></td>
<td class="type">
<span class="param-type"><a href="module-core_base-service_openapi.html#~QueryParamInput">module:core/base-service/openapi~QueryParamInput</a></span>
</td>
<td class="attributes">
&lt;repeatable><br>
</td>
<td class="description last"><p>Input params</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="core_base-service_openapi.js.html">core/base-service/openapi.js</a>, <a href="core_base-service_openapi.js.html#line432">line 432</a>
</li></ul></dd>
<dt class="tag-see">See:</dt>
<dd class="tag-see">
<ul>
<li><a href="module-core_base-service_openapi.html#~queryParam">module:core/base-service/openapi~queryParam</a></li>
</ul>
</dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Array of OpenAPI Parameter Objects</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Array.&lt;<a href="module-core_base-service_openapi.html#~OpenApiParam">module:core/base-service/openapi~OpenApiParam</a>></span>
</dd>
</dl>
<h3 class="subsection-title">Type Definitions</h3>
<h4 class="name" id="~OpenApiParam">OpenApiParam</h4>
<div class="description">
<p>OpenAPI Parameter Object</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">object</span>
</li>
</ul>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>The name of the parameter</p></td>
</tr>
<tr>
<td class="name"><code>example</code></td>
<td class="type">
<span class="param-type">string</span>
|
<span class="param-type">null</span>
</td>
<td class="description last"><p>Example of a valid value for this parameter</p></td>
</tr>
<tr>
<td class="name"><code>in</code></td>
<td class="type">
<span class="param-type">'path'</span>
|
<span class="param-type">'query'</span>
</td>
<td class="description last"><p>The location of the parameter</p></td>
</tr>
<tr>
<td class="name"><code>schema</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last"><p>Parameter schema.
An <a href="https://swagger.io/specification/#schema-object">OpenAPI Schema object</a>
specifying the parameter type.</p></td>
</tr>
<tr>
<td class="name"><code>required</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last"><p>Determines whether this parameter is mandatory</p></td>
</tr>
<tr>
<td class="name"><code>description</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>A brief description of the parameter</p></td>
</tr>
<tr>
<td class="name"><code>allowEmptyValue</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last"><p>If true, allows the ability to pass an empty value to this parameter</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="core_base-service_openapi.js.html">core/base-service/openapi.js</a>, <a href="core_base-service_openapi.js.html#line462">line 462</a>
</li></ul></dd>
</dl>
<h4 class="name" id="~PathParamInput">PathParamInput</h4>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">object</span>
</li>
</ul>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>The name of the parameter. Parameter names are case sensitive</p></td>
</tr>
<tr>
<td class="name"><code>example</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>Example of a valid value for this parameter</p></td>
</tr>
<tr>
<td class="name"><code>schema</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
{ type: 'string' }
</td>
<td class="description last"><p>Parameter schema.
An <a href="https://swagger.io/specification/#schema-object">OpenAPI Schema object</a>
specifying the parameter type.
Normally this should be omitted as all path parameters are strings.
Use this when we also want to pass an enum of valid parameters
to be presented as a drop-down in the frontend. e.g:
<code>{'type': 'string', 'enum': ['github', 'bitbucket'}</code> (Optional)</p></td>
</tr>
<tr>
<td class="name"><code>description</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>A brief description of the parameter (Optional)</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="core_base-service_openapi.js.html">core/base-service/openapi.js</a>, <a href="core_base-service_openapi.js.html#line436">line 436</a>
</li></ul></dd>
</dl>
<h4 class="name" id="~QueryParamInput">QueryParamInput</h4>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">object</span>
</li>
</ul>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>The name of the parameter. Parameter names are case sensitive</p></td>
</tr>
<tr>
<td class="name"><code>example</code></td>
<td class="type">
<span class="param-type">string</span>
|
<span class="param-type">null</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>Example of a valid value for this parameter</p></td>
</tr>
<tr>
<td class="name"><code>schema</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
{ type: 'string' }
</td>
<td class="description last"><p>Parameter schema.
An <a href="https://swagger.io/specification/#schema-object">OpenAPI Schema object</a>
specifying the parameter type. This can normally be omitted.
Query params are usually strings. (Optional)</p></td>
</tr>
<tr>
<td class="name"><code>required</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
false
</td>
<td class="description last"><p>Determines whether this parameter is mandatory (Optional)</p></td>
</tr>
<tr>
<td class="name"><code>description</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>A brief description of the parameter (Optional)</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="core_base-service_openapi.js.html">core/base-service/openapi.js</a>, <a href="core_base-service_openapi.js.html#line450">line 450</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-badge-maker.html">badge-maker</a></li><li><a href="module-badge-maker_lib_xml.html">badge-maker/lib/xml</a></li><li><a href="module-core_base-service_base.html">core/base-service/base</a></li><li><a href="module-core_base-service_base-graphql.html">core/base-service/base-graphql</a></li><li><a href="module-core_base-service_base-json.html">core/base-service/base-json</a></li><li><a href="module-core_base-service_base-svg-scraping.html">core/base-service/base-svg-scraping</a></li><li><a href="module-core_base-service_base-toml.html">core/base-service/base-toml</a></li><li><a href="module-core_base-service_base-xml.html">core/base-service/base-xml</a></li><li><a href="module-core_base-service_base-yaml.html">core/base-service/base-yaml</a></li><li><a href="module-core_base-service_errors.html">core/base-service/errors</a></li><li><a href="module-core_base-service_graphql.html">core/base-service/graphql</a></li><li><a href="module-core_base-service_openapi.html">core/base-service/openapi</a></li><li><a href="module-core_base-service_resource-cache.html">core/base-service/resource-cache</a></li><li><a href="module-core_server_server.html">core/server/server</a></li><li><a href="module-core_service-test-runner_create-service-tester.html">core/service-test-runner/create-service-tester</a></li><li><a href="module-core_service-test-runner_icedfrisby-shields.html">core/service-test-runner/icedfrisby-shields</a></li><li><a href="module-core_service-test-runner_runner.html">core/service-test-runner/runner</a></li><li><a href="module-core_service-test-runner_service-tester.html">core/service-test-runner/service-tester</a></li><li><a href="module-core_service-test-runner_services-for-title.html">core/service-test-runner/services-for-title</a></li><li><a href="module-core_token-pooling_token-pool.html">core/token-pooling/token-pool</a></li><li><a href="module-services_build-status.html">services/build-status</a></li><li><a href="module-services_color-formatters.html">services/color-formatters</a></li><li><a href="module-services_contributor-count.html">services/contributor-count</a></li><li><a href="module-services_downloads.html">services/downloads</a></li><li><a href="module-services_dynamic-common.html">services/dynamic-common</a></li><li><a href="module-services_dynamic_json-path.html">services/dynamic/json-path</a></li><li><a href="module-services_endpoint-common.html">services/endpoint-common</a></li><li><a href="module-services_licenses.html">services/licenses</a></li><li><a href="module-services_package-json-helpers.html">services/package-json-helpers</a></li><li><a href="module-services_php-version.html">services/php-version</a></li><li><a href="module-services_pipenv-helpers.html">services/pipenv-helpers</a></li><li><a href="module-services_route-builder.html">services/route-builder</a></li><li><a href="module-services_steam_steam-base.html">services/steam/steam-base</a></li><li><a href="module-services_text-formatters.html">services/text-formatters</a></li><li><a href="module-services_validators.html">services/validators</a></li><li><a href="module-services_version.html">services/version</a></li><li><a href="module-services_website-status.html">services/website-status</a></li></ul><h3>Classes</h3><ul><li><a href="BaseThunderstoreService.html">BaseThunderstoreService</a></li><li><a href="module-badge-maker_lib_xml-ElementList.html">ElementList</a></li><li><a href="module-badge-maker_lib_xml-XmlElement.html">XmlElement</a></li><li><a href="module-core_base-service_base-graphql-BaseGraphqlService.html">BaseGraphqlService</a></li><li><a href="module-core_base-service_base-json-BaseJsonService.html">BaseJsonService</a></li><li><a href="module-core_base-service_base-svg-scraping-BaseSvgScrapingService.html">BaseSvgScrapingService</a></li><li><a href="module-core_base-service_base-toml-BaseTomlService.html">BaseTomlService</a></li><li><a href="module-core_base-service_base-xml-BaseXmlService.html">BaseXmlService</a></li><li><a href="module-core_base-service_base-yaml-BaseYamlService.html">BaseYamlService</a></li><li><a href="module-core_base-service_base-BaseService.html">BaseService</a></li><li><a href="module-core_base-service_errors-Deprecated.html">Deprecated</a></li><li><a href="module-core_base-service_errors-ImproperlyConfigured.html">ImproperlyConfigured</a></li><li><a href="module-core_base-service_errors-Inaccessible.html">Inaccessible</a></li><li><a href="module-core_base-service_errors-InvalidParameter.html">InvalidParameter</a></li><li><a href="module-core_base-service_errors-InvalidResponse.html">InvalidResponse</a></li><li><a href="module-core_base-service_errors-NotFound.html">NotFound</a></li><li><a href="module-core_base-service_errors-ShieldsRuntimeError.html">ShieldsRuntimeError</a></li><li><a href="module-core_server_server-Server.html">Server</a></li><li><a href="module-core_service-test-runner_runner-Runner.html">Runner</a></li><li><a href="module-core_service-test-runner_service-tester-ServiceTester.html">ServiceTester</a></li><li><a href="module-core_token-pooling_token-pool-Token.html">Token</a></li><li><a href="module-core_token-pooling_token-pool-TokenPool.html">TokenPool</a></li><li><a href="module-services_route-builder.html">services/route-builder</a></li><li><a href="module-services_steam_steam-base-BaseSteamAPI.html">BaseSteamAPI</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-TUTORIAL.html">TUTORIAL</a></li><li><a href="tutorial-adding-new-config-values.html">adding-new-config-values</a></li><li><a href="tutorial-authentication.html">authentication</a></li><li><a href="tutorial-badge-urls.html">badge-urls</a></li><li><a href="tutorial-code-walkthrough.html">code-walkthrough</a></li><li><a href="tutorial-deprecating-badges.html">deprecating-badges</a></li><li><a href="tutorial-input-validation.html">input-validation</a></li><li><a href="tutorial-json-format.html">json-format</a></li><li><a href="tutorial-logos.html">logos</a></li><li><a href="tutorial-performance-testing.html">performance-testing</a></li><li><a href="tutorial-production-hosting.html">production-hosting</a></li><li><a href="tutorial-releases.html">releases</a></li><li><a href="tutorial-self-hosting.html">self-hosting</a></li><li><a href="tutorial-server-secrets.html">server-secrets</a></li><li><a href="tutorial-service-tests.html">service-tests</a></li><li><a href="tutorial-static-badges.html">static-badges</a></li></ul><h3>Global</h3><ul><li><a href="global.html#createNumRequestCounter">createNumRequestCounter</a></li><li><a href="global.html#isMetricWithPattern">isMetricWithPattern</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Sat Jan 13 2024 18:30:53 GMT+0000 (Coordinated Universal Time)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>