1
0
Fork 0

Correct API documentation for search (#878)

This commit is contained in:
David Libeau 2018-07-28 14:38:49 -04:00 committed by Rigel Kent
parent 469b29087b
commit fb72c19384
2 changed files with 200 additions and 174 deletions

View file

@ -135,9 +135,6 @@
<li>
<a href="#operation--videos-privacies-get"> GET /videos/privacies </a>
</li>
<li>
<a href="#operation--videos-search-get"> GET /videos/search </a>
</li>
<li>
<a href="#operation--videos--id--put"> PUT /videos/{id} </a>
</li>
@ -237,6 +234,14 @@
</li>
</ul>
</section>
<section>
<a href="#tag-Search">Search</a>
<ul>
<li>
<a href="#operation--search-videos-get"> GET /search/videos </a>
</li>
</ul>
</section>
<h5>Schema Definitions</h5>
<a href="#definition-VideoConstantNumber"> VideoConstantNumber </a>
<a href="#definition-VideoConstantString"> VideoConstantString </a>
@ -3217,158 +3222,6 @@
<!-- <div class="hljs"> --><pre><code class="hljs lang-json">[
<span class="hljs-string">&quot;string&quot;</span>
]
</code></pre>
<!-- </div> -->
</section>
</div>
</div>
</div>
<div id="operation--videos-search-get" class="operation panel" data-traverse-target="operation--videos-search-get">
<!-- <section class="operation-tags row"> -->
<!-- <div class="doc-copy"> -->
<div class="operation-tags">
<a class="label" href="#tag-Video">Video</a>
<!---->
</div>
<!-- </div> -->
<!-- </section> -->
<h2 class="operation-title">
<span class="operation-name">
<span class="operation-name">GET</span>
<span class="operation-path">/videos/search</span>
</span>
</h2>
<div class="doc-row">
<div class="doc-copy">
<section class="swagger-request-params">
<div class="prop-row prop-group">
<div class="prop-name">
<div class="prop-title">start:
<span class="prop-type">
<span class="json-property-type">number</span>
<span class="json-property-range" title="Value limits"></span>
</span>
</div>
<div class="prop-subtitle"> in query </div>
</div>
<div class="prop-value">
<p>Offset</p>
</div>
</div>
<div class="prop-row prop-group">
<div class="prop-name">
<div class="prop-title">count:
<span class="prop-type">
<span class="json-property-type">number</span>
<span class="json-property-range" title="Value limits"></span>
</span>
</div>
<div class="prop-subtitle"> in query </div>
</div>
<div class="prop-value">
<p>Number of items</p>
</div>
</div>
<div class="prop-row prop-group">
<div class="prop-name">
<div class="prop-title">sort:
<span class="prop-type">
<span class="json-property-type">string</span>
<span class="json-property-range" title="Value limits"></span>
</span>
</div>
<div class="prop-subtitle"> in query </div>
</div>
<div class="prop-value">
<p>Sort column (-createdAt for example)</p>
</div>
</div>
</section>
</div>
<div class="doc-examples"></div>
</div>
<div class="doc-row">
<div class="doc-copy">
<section class="swagger-responses">
<div class="prop-row prop-group">
<div class="prop-name">
<div class="prop-title">200 OK</div>
<div class="prop-ref">
<span class="json-schema-ref-array">
<a class="json-schema-ref" href="#/definitions/Video">Video</a>
</span>
</div>
<!-- <span class="swagger-global"></span> <span class="json-schema-reference"><a href=""></a></span> -->
</div>
<div class="prop-value">
<p>successful operation</p>
</div>
</div>
<div class="prop-row prop-inner">
<div class="prop-name">type</div>
<div class="prop-value">
<span class="json-property-type">
<span class="json-schema-ref-array">
<a class="json-schema-ref" href="#/definitions/Video">Video</a>
</span>
</span>
<span class="json-property-range" title="Value limits"></span>
</div>
</div>
</section>
</div>
<div class="doc-examples">
<h5>Response Content-Types:
<span>application/json</span>
</h5>
<section>
<h5>Response Example
<span>(200 OK)</span>
</h5>
<!-- <div class="hljs"> --><pre><code class="hljs lang-json">[
{
<span class="hljs-attr">&quot;id&quot;</span>: <span class="hljs-string">&quot;number&quot;</span>,
<span class="hljs-attr">&quot;uuid&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>,
<span class="hljs-attr">&quot;createdAt&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>,
<span class="hljs-attr">&quot;publishedAt&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>,
<span class="hljs-attr">&quot;updatedAt&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>,
<span class="hljs-attr">&quot;category&quot;</span>: {
<span class="hljs-attr">&quot;id&quot;</span>: <span class="hljs-string">&quot;number&quot;</span>,
<span class="hljs-attr">&quot;label&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>
},
<span class="hljs-attr">&quot;licence&quot;</span>: {
<span class="hljs-attr">&quot;id&quot;</span>: <span class="hljs-string">&quot;number&quot;</span>,
<span class="hljs-attr">&quot;label&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>
},
<span class="hljs-attr">&quot;language&quot;</span>: {
<span class="hljs-attr">&quot;id&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>,
<span class="hljs-attr">&quot;label&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>
},
<span class="hljs-attr">&quot;privacy&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>,
<span class="hljs-attr">&quot;description&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>,
<span class="hljs-attr">&quot;duration&quot;</span>: <span class="hljs-string">&quot;number&quot;</span>,
<span class="hljs-attr">&quot;isLocal&quot;</span>: <span class="hljs-string">&quot;boolean&quot;</span>,
<span class="hljs-attr">&quot;name&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>,
<span class="hljs-attr">&quot;thumbnailPath&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>,
<span class="hljs-attr">&quot;previewPath&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>,
<span class="hljs-attr">&quot;embedPath&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>,
<span class="hljs-attr">&quot;views&quot;</span>: <span class="hljs-string">&quot;number&quot;</span>,
<span class="hljs-attr">&quot;likes&quot;</span>: <span class="hljs-string">&quot;number&quot;</span>,
<span class="hljs-attr">&quot;dislikes&quot;</span>: <span class="hljs-string">&quot;number&quot;</span>,
<span class="hljs-attr">&quot;nsfw&quot;</span>: <span class="hljs-string">&quot;boolean&quot;</span>,
<span class="hljs-attr">&quot;account&quot;</span>: {
<span class="hljs-attr">&quot;name&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>,
<span class="hljs-attr">&quot;displayName&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>,
<span class="hljs-attr">&quot;url&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>,
<span class="hljs-attr">&quot;host&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>,
<span class="hljs-attr">&quot;avatar&quot;</span>: {
<span class="hljs-attr">&quot;path&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>,
<span class="hljs-attr">&quot;createdAt&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>,
<span class="hljs-attr">&quot;updatedAt&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>
}
}
}
]
</code></pre>
<!-- </div> -->
</section>
@ -6328,6 +6181,174 @@
</div>
</div>
</div>
<h1 id="tag-Search" class="swagger-summary-tag" data-traverse-target="tag-Search">Search</h1>
<div id="operation--search-videos-get" class="operation panel" data-traverse-target="operation--search-videos-get">
<!-- <section class="operation-tags row"> -->
<!-- <div class="doc-copy"> -->
<div class="operation-tags">
<a class="label" href="#tag-Search">Search</a>
<!---->
</div>
<!-- </div> -->
<!-- </section> -->
<h2 class="operation-title">
<span class="operation-name">
<span class="operation-name">GET</span>
<span class="operation-path">/search/videos</span>
</span>
</h2>
<div class="doc-row">
<div class="doc-copy">
<section class="swagger-request-params">
<div class="prop-row prop-group">
<div class="prop-name">
<div class="prop-title">start:
<span class="prop-type">
<span class="json-property-type">number</span>
<span class="json-property-range" title="Value limits"></span>
</span>
</div>
<div class="prop-subtitle"> in query </div>
</div>
<div class="prop-value">
<p>Offset</p>
</div>
</div>
<div class="prop-row prop-group">
<div class="prop-name">
<div class="prop-title">count:
<span class="prop-type">
<span class="json-property-type">number</span>
<span class="json-property-range" title="Value limits"></span>
</span>
</div>
<div class="prop-subtitle"> in query </div>
</div>
<div class="prop-value">
<p>Number of items</p>
</div>
</div>
<div class="prop-row prop-group">
<div class="prop-name">
<div class="prop-title">sort:
<span class="prop-type">
<span class="json-property-type">string</span>
<span class="json-property-range" title="Value limits"></span>
</span>
</div>
<div class="prop-subtitle"> in query </div>
</div>
<div class="prop-value">
<p>Sort column (-createdAt for example)</p>
</div>
</div>
<div class="prop-row prop-group">
<div class="prop-name">
<div class="prop-title">query:
<span class="prop-type">
<span class="json-property-type">string</span>
<span class="json-property-range" title="Value limits"></span>
</span>
</div>
<span class="json-property-required"></span>
<div class="prop-subtitle"> in query </div>
</div>
<div class="prop-value">
<p>String to search</p>
</div>
</div>
</section>
</div>
<div class="doc-examples"></div>
</div>
<div class="doc-row">
<div class="doc-copy">
<section class="swagger-responses">
<div class="prop-row prop-group">
<div class="prop-name">
<div class="prop-title">200 OK</div>
<div class="prop-ref">
<span class="json-schema-ref-array">
<a class="json-schema-ref" href="#/definitions/Video">Video</a>
</span>
</div>
<!-- <span class="swagger-global"></span> <span class="json-schema-reference"><a href=""></a></span> -->
</div>
<div class="prop-value">
<p>successful operation</p>
</div>
</div>
<div class="prop-row prop-inner">
<div class="prop-name">type</div>
<div class="prop-value">
<span class="json-property-type">
<span class="json-schema-ref-array">
<a class="json-schema-ref" href="#/definitions/Video">Video</a>
</span>
</span>
<span class="json-property-range" title="Value limits"></span>
</div>
</div>
</section>
</div>
<div class="doc-examples">
<h5>Response Content-Types:
<span>application/json</span>
</h5>
<section>
<h5>Response Example
<span>(200 OK)</span>
</h5>
<!-- <div class="hljs"> --><pre><code class="hljs lang-json">[
{
<span class="hljs-attr">&quot;id&quot;</span>: <span class="hljs-string">&quot;number&quot;</span>,
<span class="hljs-attr">&quot;uuid&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>,
<span class="hljs-attr">&quot;createdAt&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>,
<span class="hljs-attr">&quot;publishedAt&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>,
<span class="hljs-attr">&quot;updatedAt&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>,
<span class="hljs-attr">&quot;category&quot;</span>: {
<span class="hljs-attr">&quot;id&quot;</span>: <span class="hljs-string">&quot;number&quot;</span>,
<span class="hljs-attr">&quot;label&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>
},
<span class="hljs-attr">&quot;licence&quot;</span>: {
<span class="hljs-attr">&quot;id&quot;</span>: <span class="hljs-string">&quot;number&quot;</span>,
<span class="hljs-attr">&quot;label&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>
},
<span class="hljs-attr">&quot;language&quot;</span>: {
<span class="hljs-attr">&quot;id&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>,
<span class="hljs-attr">&quot;label&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>
},
<span class="hljs-attr">&quot;privacy&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>,
<span class="hljs-attr">&quot;description&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>,
<span class="hljs-attr">&quot;duration&quot;</span>: <span class="hljs-string">&quot;number&quot;</span>,
<span class="hljs-attr">&quot;isLocal&quot;</span>: <span class="hljs-string">&quot;boolean&quot;</span>,
<span class="hljs-attr">&quot;name&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>,
<span class="hljs-attr">&quot;thumbnailPath&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>,
<span class="hljs-attr">&quot;previewPath&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>,
<span class="hljs-attr">&quot;embedPath&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>,
<span class="hljs-attr">&quot;views&quot;</span>: <span class="hljs-string">&quot;number&quot;</span>,
<span class="hljs-attr">&quot;likes&quot;</span>: <span class="hljs-string">&quot;number&quot;</span>,
<span class="hljs-attr">&quot;dislikes&quot;</span>: <span class="hljs-string">&quot;number&quot;</span>,
<span class="hljs-attr">&quot;nsfw&quot;</span>: <span class="hljs-string">&quot;boolean&quot;</span>,
<span class="hljs-attr">&quot;account&quot;</span>: {
<span class="hljs-attr">&quot;name&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>,
<span class="hljs-attr">&quot;displayName&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>,
<span class="hljs-attr">&quot;url&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>,
<span class="hljs-attr">&quot;host&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>,
<span class="hljs-attr">&quot;avatar&quot;</span>: {
<span class="hljs-attr">&quot;path&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>,
<span class="hljs-attr">&quot;createdAt&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>,
<span class="hljs-attr">&quot;updatedAt&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>
}
}
}
]
</code></pre>
<!-- </div> -->
</section>
</div>
</div>
</div>
<h1>Schema Definitions</h1>
<div id="definition-VideoConstantNumber" class="definition panel" data-traverse-target="definition-VideoConstantNumber">
<h2 class="panel-title">

View file

@ -512,25 +512,6 @@ paths:
type: array
items:
type: string
/videos/search:
get:
tags:
- Video
consumes:
- application/json
produces:
- application/json
parameters:
- $ref: "commons.yaml#/parameters/start"
- $ref: "commons.yaml#/parameters/count"
- $ref: "commons.yaml#/parameters/sort"
responses:
'200':
description: successful operation
schema:
type: array
items:
$ref: '#/definitions/Video'
"/videos/{id}":
put:
security:
@ -957,6 +938,30 @@ paths:
responses:
'204':
$ref: "commons.yaml#/responses/emptySuccess"
/search/videos:
get:
tags:
- Search
consumes:
- application/json
produces:
- application/json
parameters:
- $ref: "commons.yaml#/parameters/start"
- $ref: "commons.yaml#/parameters/count"
- $ref: "commons.yaml#/parameters/sort"
- name: query
in: query
required: true
type: string
description: 'String to search'
responses:
'200':
description: successful operation
schema:
type: array
items:
$ref: '#/definitions/Video'
definitions:
VideoConstantNumber:
properties: