implemented /help route
This commit is contained in:
@ -65,6 +65,7 @@ tags:
|
||||
- name: /template
|
||||
- name: /model
|
||||
- name: /user
|
||||
- name: /help
|
||||
|
||||
|
||||
paths:
|
||||
@ -76,6 +77,7 @@ paths:
|
||||
- $ref: 'template.yaml'
|
||||
- $ref: 'model.yaml'
|
||||
- $ref: 'user.yaml'
|
||||
- $ref: 'help.yaml'
|
||||
|
||||
|
||||
components:
|
||||
|
60
api/help.yaml
Normal file
60
api/help.yaml
Normal file
@ -0,0 +1,60 @@
|
||||
/help/{key}:
|
||||
parameters:
|
||||
- $ref: 'api.yaml#/components/parameters/Key'
|
||||
get:
|
||||
summary: get help text for key
|
||||
description: 'Auth: basic, levels: predict, read, write, dev, admin, depending on the set document level'
|
||||
tags:
|
||||
- /help
|
||||
responses:
|
||||
200:
|
||||
description: the required text
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: 'api.yaml#/components/schemas/Help'
|
||||
403:
|
||||
$ref: 'api.yaml#/components/responses/403'
|
||||
404:
|
||||
$ref: 'api.yaml#/components/responses/404'
|
||||
500:
|
||||
$ref: 'api.yaml#/components/responses/500'
|
||||
post:
|
||||
summary: add/replace help text
|
||||
description: 'Auth: basic, levels: dev, admin <br> If the given key exists, the item is replaced,
|
||||
otherwise it is newly created'
|
||||
tags:
|
||||
- /help
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: 'api.yaml#/components/schemas/Help'
|
||||
responses:
|
||||
200:
|
||||
$ref: 'api.yaml#/components/responses/Ok'
|
||||
400:
|
||||
$ref: 'api.yaml#/components/responses/400'
|
||||
401:
|
||||
$ref: 'api.yaml#/components/responses/401'
|
||||
403:
|
||||
$ref: 'api.yaml#/components/responses/403'
|
||||
500:
|
||||
$ref: 'api.yaml#/components/responses/500'
|
||||
delete:
|
||||
summary: remove help text
|
||||
description: 'Auth: basic, levels: dev, admin'
|
||||
tags:
|
||||
- /help
|
||||
responses:
|
||||
200:
|
||||
$ref: 'api.yaml#/components/responses/Ok'
|
||||
401:
|
||||
$ref: 'api.yaml#/components/responses/401'
|
||||
403:
|
||||
$ref: 'api.yaml#/components/responses/403'
|
||||
404:
|
||||
$ref: 'api.yaml#/components/responses/404'
|
||||
500:
|
||||
$ref: 'api.yaml#/components/responses/500'
|
@ -46,4 +46,13 @@ Group:
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
example: vn
|
||||
example: vn
|
||||
|
||||
Key:
|
||||
name: key
|
||||
description: URIComponent encoded string
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
example: '%2Fdocumentation%2Fdatabase'
|
@ -232,4 +232,14 @@ ModelItem:
|
||||
example: https://definma-model-test.apps.de1.bosch-iot-cloud.com/predict/model1-1
|
||||
label:
|
||||
type: string
|
||||
example: 'ml/g'
|
||||
example: 'ml/g'
|
||||
|
||||
Help:
|
||||
properties:
|
||||
text:
|
||||
type: string
|
||||
example: This page documents the database.
|
||||
level:
|
||||
type: string
|
||||
description: can be also null to allow access without authorization
|
||||
example: read
|
Reference in New Issue
Block a user