From 66b54bad317402250cac96c765406f9540a6b126 Mon Sep 17 00:00:00 2001 From: nobohan Date: Tue, 8 Jun 2021 08:55:41 +0200 Subject: [PATCH] household address: add swagger documentation --- .../ChillPersonBundle/chill.api.specs.yaml | 84 +++++++++++++++++-- 1 file changed, 77 insertions(+), 7 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/chill.api.specs.yaml b/src/Bundle/ChillPersonBundle/chill.api.specs.yaml index 0fac8e6ce..94d7fb98e 100644 --- a/src/Bundle/ChillPersonBundle/chill.api.specs.yaml +++ b/src/Bundle/ChillPersonBundle/chill.api.specs.yaml @@ -179,7 +179,7 @@ components: readOnly: true children_ids: type: array - items: + items: type: integer readOnly: true title: @@ -210,7 +210,7 @@ components: type: string enum: - 'household_position' - + paths: /1.0/person/person/{id}.json: @@ -259,10 +259,10 @@ paths: 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: - tags: + tags: - social-issue summary: Return a list of social work responses: @@ -270,7 +270,7 @@ paths: description: "ok" /1.0/person/social-work/social-issue/{id}.json: get: - tags: + tags: - social-issue summary: Return a social issue by id parameters: @@ -424,7 +424,7 @@ paths: description: "OK" 422: description: "object with validation errors" - + /1.0/person/accompanying-course/{id}/participation.json: post: tags: @@ -784,6 +784,41 @@ paths: 400: description: "transition cannot be applyed" + /1.0/person/household.json: + get: + tags: + - household + summary: Return a list of all household + responses: + 200: + description: "ok" + + /1.0/person/household/{id}.json: + get: + tags: + - household + summary: Return a household by id + parameters: + - name: id + in: path + required: true + description: The household id + schema: + type: integer + format: integer + minimum: 1 + responses: + 200: + description: "ok" + content: + application/json: + schema: + $ref: '#/components/schemas/Household' + 404: + description: "not found" + 401: + description: "Unauthorized" + /1.0/person/household/members/move.json: post: tags: @@ -825,4 +860,39 @@ paths: description: "Unprocessable entity (validation errors)" 400: description: "transition cannot be applyed" - + + /1.0/person/household/{id}/address.json: + post: + tags: + - household + summary: post an address to a household + parameters: + - name: id + in: path + required: true + description: The household id + schema: + type: integer + format: integer + minimum: 1 + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + id: + type: integer + description: The address id to attach to the household + responses: + 401: + description: "Unauthorized" + 404: + description: "Not found" + 200: + description: "OK" + 422: + description: "Unprocessable entity (validation errors)" + 400: + description: "transition cannot be applyed"