1
0
Michael Hoennig eb9edf1cb1 remove current-subject from OpenAPI header specs, use Authorization instead (#164)
Co-authored-by: Michael Hoennig <michael@hoennig.de>
Reviewed-on: https://dev.hostsharing.net/hostsharing/hs.hsadmin.ng/pulls/164
Reviewed-by: Timotheus Pokorra <timotheus.pokorra@hostsharing.net>
2025-03-18 11:52:29 +01:00

82 lines
3.0 KiB
YAML

get:
summary: Returns a list of (optionally filtered) person relations for a given person.
description:
Returns the list of (optionally filtered) person relations of a given person and which are visible to the current subject or any of it's assumed roles.
To match data, all given query parameters must be fulfilled ('and' / logical conjunction).
tags:
- hs-office-relations
operationId: getListOfRelations
parameters:
- $ref: 'auth.yaml#/components/parameters/assumedRoles'
- name: personUuid
in: query
required: false
schema:
type: string
format: uuid
description: Prefix of name properties from holder or contact to filter the results.
- name: relationType
in: query
required: false
schema:
$ref: 'hs-office-relation-schemas.yaml#/components/schemas/HsOfficeRelationType'
description: Beginning of name properties from holder or contact to filter the results.
- name: mark
in: query
required: false
schema:
type: string
description:
- name: personData
in: query
required: false
schema:
type: string
description: 'Data from any of these text field in the anchor or holder person: tradeName, familyName, givenName'
- name: contactData
in: query
required: false
schema:
type: string
description: 'Data from any of these text field in the contact: caption, postalAddress, emailAddresses, phoneNumbers'
responses:
"200":
description: OK
content:
'application/json':
schema:
type: array
items:
$ref: 'hs-office-relation-schemas.yaml#/components/schemas/HsOfficeRelation'
"401":
$ref: 'error-responses.yaml#/components/responses/Unauthorized'
"403":
$ref: 'error-responses.yaml#/components/responses/Forbidden'
post:
summary: Adds a new person relation.
tags:
- hs-office-relations
operationId: postNewRelation
parameters:
- $ref: 'auth.yaml#/components/parameters/assumedRoles'
requestBody:
content:
'application/json':
schema:
$ref: 'hs-office-relation-schemas.yaml#/components/schemas/HsOfficeRelationInsert'
required: true
responses:
"201":
description: Created
content:
'application/json':
schema:
$ref: 'hs-office-relation-schemas.yaml#/components/schemas/HsOfficeRelation'
"401":
$ref: 'error-responses.yaml#/components/responses/Unauthorized'
"403":
$ref: 'error-responses.yaml#/components/responses/Forbidden'
"409":
$ref: 'error-responses.yaml#/components/responses/Conflict'