add route for comment + track update/creation of entities

This commit is contained in:
2021-05-13 17:25:24 +02:00
parent 05798688d0
commit 3e85529468
9 changed files with 229 additions and 4 deletions

View File

@@ -92,6 +92,31 @@ components:
required:
- id
- type
Comment:
type: object
properties:
type:
type: string
enum:
- 'accompanying_period_comment'
readOnly: true
id:
type: integer
readOnly: true
content:
type: string
CommentById:
type: object
properties:
id:
type: integer
type:
type: string
enum:
- 'accompanying_period_comment'
required:
- id
- type
paths:
/1.0/person/accompanying-course/{id}.json:
@@ -345,3 +370,72 @@ paths:
description: "OK"
422:
description: "object with validation errors"
/1.0/person/accompanying-course/{id}/comment.json:
post:
tags:
- person
summary: "Add a comment 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 comment"
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Comment'
examples:
a single comment:
summary: "a simple comment"
value:
type: accompanying_period_comment
content: |
This is a funny comment I would like to share with you.
Thank you for reading this !
responses:
401:
description: "Unauthorized"
404:
description: "Not found"
200:
description: "OK"
422:
description: "object with validation errors"
delete:
tags:
- person
summary: "Remove the resource"
parameters:
- name: id
in: path
required: true
description: The accompanying period's id
schema:
type: integer
format: integer
minimum: 1
requestBody:
description: "A resource"
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CommentById'
responses:
401:
description: "Unauthorized"
404:
description: "Not found"
200:
description: "OK"
422:
description: "object with validation errors"