Archived
2

adapted api doc

This commit is contained in:
VLE2FE
2020-05-13 17:28:18 +02:00
parent c84d0ebf0c
commit 649a0b166e
10 changed files with 269 additions and 281 deletions

View File

@ -145,6 +145,11 @@ Template:
properties:
name:
type: string
example: humidity
version:
type: number
readOnly: true
example: 1
parameters:
type: array
items:
@ -152,8 +157,20 @@ Template:
properties:
name:
type: string
example: kf
range:
type: object
example:
min: 0
max: 2
TreatmentTemplate:
allOf:
- $ref: 'api.yaml#/components/schemas/Template'
properties:
number_prefix:
type: string
example: B
Email:
properties:

View File

@ -14,23 +14,15 @@
schema:
type: array
items:
$ref: 'api.yaml#/components/schemas/Template'
example:
_id: 5ea0450ed851c30a90e70894
name: heat aging
parameters:
- name: method
range:
values:
- copper
- hot air
$ref: 'api.yaml#/components/schemas/TreatmentTemplate'
401:
$ref: 'api.yaml#/components/responses/401'
500:
$ref: 'api.yaml#/components/responses/500'
/template/treatment/{name}:
/template/treatment/{id}:
parameters:
- $ref: 'api.yaml#/components/parameters/Name'
- $ref: 'api.yaml#/components/parameters/Id'
get:
summary: treatment method details
description: 'Auth: basic, levels: read, write, maintain, admin'
@ -44,17 +36,7 @@
content:
application/json:
schema:
allOf:
- $ref: 'api.yaml#/components/schemas/Template'
example:
_id: 5ea0450ed851c30a90e70894
name: heat aging
parameters:
- name: method
range:
values:
- copper
- hot air
$ref: 'api.yaml#/components/schemas/TreatmentTemplate'
401:
$ref: 'api.yaml#/components/responses/401'
404:
@ -62,8 +44,9 @@
500:
$ref: 'api.yaml#/components/responses/500'
put:
summary: add/change treatment method
summary: change treatment method
description: 'Auth: basic, levels: maintain, admin'
x-doc: With a change a new version is set, resulting in a new template with a new id
tags:
- /template
security:
@ -73,33 +56,14 @@
content:
application/json:
schema:
allOf:
- $ref: 'api.yaml#/components/schemas/Template'
example:
name: heat aging
parameters:
- name: method
range:
values:
- copper
- hot air
$ref: 'api.yaml#/components/schemas/TreatmentTemplate'
responses:
200:
description: treatment details
content:
application/json:
schema:
allOf:
- $ref: 'api.yaml#/components/schemas/Template'
example:
_id: 5ea0450ed851c30a90e70894
name: heat aging
parameters:
- name: method
range:
values:
- copper
- hot air
$ref: 'api.yaml#/components/schemas/TreatmentTemplate'
400:
$ref: 'api.yaml#/components/responses/400'
401:
@ -110,26 +74,37 @@
$ref: 'api.yaml#/components/responses/404'
500:
$ref: 'api.yaml#/components/responses/500'
delete:
summary: delete treatment method
/template/treatment/new:
post:
summary: add treatment method
description: 'Auth: basic, levels: maintain, admin'
tags:
- /template
security:
- BasicAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: 'api.yaml#/components/schemas/TreatmentTemplate'
responses:
200:
$ref: 'api.yaml#/components/responses/Ok'
description: treatment details
content:
application/json:
schema:
$ref: 'api.yaml#/components/schemas/TreatmentTemplate'
400:
$ref: 'api.yaml#/components/responses/400'
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'
/template/measurements:
get:
summary: all available measurement methods
@ -147,21 +122,13 @@
type: array
items:
$ref: 'api.yaml#/components/schemas/Template'
example:
_id: 5ea0450ed851c30a90e70894
name: humidity
parameters:
- name: kf
range:
min: 0
max: 2
401:
$ref: 'api.yaml#/components/responses/401'
500:
$ref: 'api.yaml#/components/responses/500'
/template/measurement/{name}:
/template/measurement/{id}:
parameters:
- $ref: 'api.yaml#/components/parameters/Name'
- $ref: 'api.yaml#/components/parameters/Id'
get:
summary: measurement method details
description: 'Auth: basic, levels: read, write, maintain, admin'
@ -175,16 +142,7 @@
content:
application/json:
schema:
allOf:
- $ref: 'api.yaml#/components/schemas/Template'
example:
_id: 5ea0450ed851c30a90e70894
name: humidity
parameters:
- name: kf
range:
min: 0
max: 2
$ref: 'api.yaml#/components/schemas/Template'
400:
$ref: 'api.yaml#/components/responses/400'
401:
@ -194,7 +152,7 @@
500:
$ref: 'api.yaml#/components/responses/500'
put:
summary: add/change measurement method
summary: change measurement method
description: 'Auth: basic, levels: maintain, admin'
tags:
- /template
@ -205,32 +163,14 @@
content:
application/json:
schema:
allOf:
- $ref: 'api.yaml#/components/schemas/Template'
example:
_id: 5ea0450ed851c30a90e70894
name: humidity
parameters:
- name: kf
range:
min: 0
max: 2
$ref: 'api.yaml#/components/schemas/Template'
responses:
200:
description: measurement details
content:
application/json:
schema:
allOf:
- $ref: 'api.yaml#/components/schemas/Template'
example:
_id: 5ea0450ed851c30a90e70894
name: humidity
parameters:
- name: kf
range:
min: 0
max: 2
$ref: 'api.yaml#/components/schemas/Template'
400:
$ref: 'api.yaml#/components/responses/400'
401:
@ -241,23 +181,33 @@
$ref: 'api.yaml#/components/responses/404'
500:
$ref: 'api.yaml#/components/responses/500'
delete:
summary: delete measurement method
/template/measurement/new:
post:
summary: add measurement method
description: 'Auth: basic, levels: maintain, admin'
tags:
- /template
security:
- BasicAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: 'api.yaml#/components/schemas/Template'
responses:
200:
$ref: 'api.yaml#/components/responses/Ok'
description: measurement details
content:
application/json:
schema:
$ref: 'api.yaml#/components/schemas/Template'
400:
$ref: 'api.yaml#/components/responses/400'
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'