add route for creating a person, and post api

This commit is contained in:
2021-05-21 18:05:03 +02:00
parent 857298b8b8
commit ebe3bc5f7b
8 changed files with 246 additions and 19 deletions

View File

@@ -41,6 +41,11 @@ components:
properties:
id:
type: integer
readOnly: true
type:
type: string
enum:
- 'person'
firstName:
type: string
lastName:
@@ -48,12 +53,23 @@ components:
text:
type: string
description: a canonical representation for the person name
readOnly: true
birthdate:
$ref: '#/components/schemas/Date'
phonenumber:
type: string
mobilenumber:
type: string
gender:
type: string
enum:
- man
- woman
- both
gender_numeric:
type: integer
description: a numerical representation of gender
readOnly: true
PersonById:
type: object
properties:
@@ -201,6 +217,29 @@ paths:
$ref: "#/components/schemas/Person"
403:
description: "Unauthorized"
/1.0/person/person.json:
post:
tags:
- person
summary: Create a single person
requestBody:
description: "A person"
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Person'
responses:
200:
description: "OK"
content:
application/json:
schema:
$ref: "#/components/schemas/Person"
403:
description: "Unauthorized"
422:
description: "Invalid data: the data is a valid json, could be deserialized, but does not pass validation"
/1.0/person/social-work/social-issue.json:
get: