add particiaption to openapi

This commit is contained in:
Julien Fastré 2021-05-12 18:32:15 +02:00
parent 91e4d585ff
commit 929d40ff6e

View File

@ -3,23 +3,34 @@ components:
PersonById:
type: object
properties:
person_id:
id:
type: integer
type:
type: string
enum:
- 'person'
required:
- person_id
- id
- type
ThirdPartyById:
type: object
properties:
thirdparty_id:
id:
type: integer
type:
type: string
enum:
- 'thirdparty'
required:
- thirdparty_id
- id
- type
AccompanyingPeriod:
type: object
properties:
type:
type: string
x-fixed-value: 'accompanying_period'
enum:
- accompanying_period
id:
type: integer
requestorAnonymous:
@ -75,6 +86,8 @@ paths:
description: "Not found"
200:
description: "OK"
422:
description: "object with validation errors"
/1.0/person/accompanying-course/{id}/requestor.json:
post:
tags:
@ -98,6 +111,17 @@ paths:
oneOf:
- $ref: '#/components/schemas/PersonById'
- $ref: '#/components/schemas/ThirdPartyById'
examples:
add person with id 50:
summary: "a person with id 50"
value:
type: person
id: 50
add thirdparty with id 100:
summary: "a third party with id 100"
value:
type: thirdparty
id: 100
responses:
401:
description: "Unauthorized"
@ -105,6 +129,8 @@ paths:
description: "Not found"
200:
description: "OK"
422:
description: "object with validation errors"
delete:
tags:
- person
@ -125,4 +151,65 @@ paths:
description: "Not found"
200:
description: "OK"
422:
description: "object with validation errors"
/1.0/person/accompanying-course/{id}/participation.json:
post:
tags:
- person
summary: "Add a participant to the accompanying course"
parameters:
- name: id
in: path
required: true
description: The accompanying period's id
schema:
type: integer
format: integer
minimum: 1
requestBody:
description: "A person"
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PersonById'
responses:
401:
description: "Unauthorized"
404:
description: "Not found"
200:
description: "OK"
422:
description: "object with validation errors"
delete:
tags:
- person
summary: "Remove the participant for the accompanying course"
parameters:
- name: id
in: path
required: true
description: The accompanying period's id
schema:
type: integer
format: integer
minimum: 1
requestBody:
description: "A person"
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PersonById'
responses:
401:
description: "Unauthorized"
404:
description: "Not found"
200:
description: "OK"
422:
description: "object with validation errors"