Files
GenerationsHeritage/api/openapi.json

3328 lines
124 KiB
JSON

{
"openapi": "3.0.3",
"info": {
"title": "db-adapter",
"version": "0.0.1"
},
"servers": [
{
"description": "production server",
"url": "http://0.0.0.0:7689"
},
{
"description": "staging server",
"url": "http://0.0.0.0:7699"
},
{
"description": "development server",
"url": "http://0.0.0.0:7698"
}
],
"paths": {
"/health": {
"get": {
"summary": "Check the health of the server",
"operationId": "healthCheck",
"responses": {
"200": {
"description": "Server is healthy",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"503": {
"description": "Server is unhealthy",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/person_and_relationship/{id}": {
"post": {
"summary": "Create a person and relationship",
"operationId": "createPersonAndRelationship",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "X-User-ID",
"in": "header",
"required": true,
"schema": {
"type": "integer"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"person": {
"$ref": "#/components/schemas/PersonRegistration"
},
"type": {
"type": "string",
"enum": [
"child",
"parent",
"spouse",
"sibling"
]
},
"relationship": {
"$ref": "#/components/schemas/FamilyRelationship"
}
},
"required": [
"person",
"relationship"
]
}
}
}
},
"responses": {
"200": {
"description": "Person and relationship created",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"person": {
"$ref": "#/components/schemas/Person"
},
"relationships": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Relationship"
}
}
}
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/person": {
"post": {
"summary": "Create a new person",
"operationId": "createPerson",
"parameters": [
{
"name": "X-User-ID",
"in": "header",
"required": true,
"schema": {
"type": "integer"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PersonRegistration"
}
}
}
},
"responses": {
"200": {
"description": "Person created",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Person"
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/comment/{id}": {
"post": {
"summary": "Comment on person's profile by ID",
"operationId": "commentOnPerson",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "X-User-ID",
"in": "header",
"required": true,
"schema": {
"type": "integer"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Message"
}
}
}
},
"responses": {
"200": {
"description": "Message updated",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Messages"
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
}
}
},
"get": {
"summary": "Get comments on person's profile by ID",
"operationId": "GetCommentsOnPerson",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "X-User-ID",
"in": "header",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "Comments",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Messages"
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
}
}
},
"patch": {
"summary": "Edit comment on person's profile by ID",
"operationId": "editComment",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "X-User-ID",
"in": "header",
"required": true,
"schema": {
"type": "integer"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Message"
}
}
}
},
"responses": {
"200": {
"description": "Comment updated",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Messages"
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
}
}
},
"delete": {
"summary": "Comment on person's profile by ID",
"operationId": "deleteCommentOnPerson",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "X-User-ID",
"in": "header",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "Deleted comment",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/person/{id}": {
"patch": {
"summary": "Update a person by ID",
"operationId": "updatePerson",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "X-User-ID",
"in": "header",
"required": true,
"schema": {
"type": "integer"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PersonProperties"
}
}
}
},
"responses": {
"200": {
"description": "Person updated",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Person"
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
}
}
},
"delete": {
"summary": "Soft delete a person by ID",
"operationId": "softDeletePerson",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "X-User-ID",
"in": "header",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "Person soft deleted"
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
}
}
},
"get": {
"summary": "Get a person by ID",
"operationId": "getPersonById",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "X-User-ID",
"in": "header",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "Person retrieved",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Person"
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/person/{id}/hard-delete": {
"delete": {
"summary": "Hard delete a person by ID",
"operationId": "hardDeletePerson",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "X-User-ID",
"in": "header",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "Person hard deleted"
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/person/google/{google_id}": {
"post": {
"summary": "Create a new person by Google ID",
"operationId": "createPersonByGoogleId",
"parameters": [
{
"name": "google_id",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PersonRegistration"
}
}
}
},
"responses": {
"200": {
"description": "Person created",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Person"
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
}
}
},
"patch": {
"summary": "Create a new person by Google ID with invite code",
"operationId": "createPersonByGoogleIdAndInviteCode",
"parameters": [
{
"name": "google_id",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"invite_code",
"person"
],
"properties": {
"invite_code": {
"type": "string"
},
"person": {
"$ref": "#/components/schemas/PersonRegistration"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Person created",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Person"
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
}
}
},
"get": {
"summary": "Get a person by Google ID",
"operationId": "getPersonByGoogleId",
"parameters": [
{
"name": "google_id",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Person retrieved",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Person"
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/family-tree": {
"get": {
"summary": "Get family tree by person ID",
"operationId": "getFamilyTreeById",
"parameters": [
{
"name": "X-User-ID",
"in": "header",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "Family tree retrieved",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FamilyTree"
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/family-tree-with-spouses": {
"get": {
"summary": "Get family tree by person ID with spouses included",
"operationId": "getFamilyTreeWithSpousesById",
"parameters": [
{
"name": "X-User-ID",
"in": "header",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "Family tree retrieved",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FamilyTree"
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/person/{id}/recipes": {
"get": {
"summary": "Get recipes by person ID",
"operationId": "getRecipesByPersonId",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "X-User-ID",
"in": "header",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "Recipes retrieved",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"recipeRelations": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Likes"
}
},
"recipes": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Recipe"
}
}
}
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/relationship": {
"post": {
"summary": "Create a relationship between two persons",
"operationId": "createRelationship",
"parameters": [
{
"name": "X-User-ID",
"in": "header",
"required": true,
"schema": {
"type": "integer"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"id1": {
"type": "integer"
},
"id2": {
"type": "integer"
},
"type": {
"type": "string",
"enum": [
"child",
"parent",
"spouse",
"sibling"
]
},
"relationship": {
"$ref": "#/components/schemas/FamilyRelationship"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Relationships created",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/dbtypeRelationship"
}
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/relationship/{id1}/{id2}": {
"get": {
"summary": "Get relationships between two persons",
"operationId": "getRelationship",
"parameters": [
{
"name": "id1",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "id2",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "X-User-ID",
"in": "header",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "Relationship retrieved",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Relationship"
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
}
}
},
"patch": {
"summary": "Update a relationship between two persons",
"operationId": "updateRelationship",
"parameters": [
{
"name": "id1",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "id2",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "X-User-ID",
"in": "header",
"required": true,
"schema": {
"type": "integer"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"relationship": {
"$ref": "#/components/schemas/FamilyRelationship"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Relationship created",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Relationship"
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
}
}
},
"delete": {
"summary": "Delete relationship between two persons",
"operationId": "deleteRelationship",
"parameters": [
{
"name": "id1",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "id2",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "X-User-ID",
"in": "header",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "Relationship deleted",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/admin/{id1}": {
"get": {
"summary": "Get profile Admins",
"operationId": "getProfileAdmins",
"parameters": [
{
"name": "id1",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "X-User-ID",
"in": "header",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "Admins retrieved",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"admins": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Admin"
}
}
}
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/admin/{id1}/{id2}": {
"get": {
"summary": "Get admin relationship between two persons",
"operationId": "getAdminRelationship",
"parameters": [
{
"name": "id1",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "id2",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "X-User-ID",
"in": "header",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "Admin retrieved",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AdminRelationship"
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
}
}
},
"post": {
"summary": "Create admin relationship between two persons",
"operationId": "createAdminRelationship",
"parameters": [
{
"name": "id1",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "id2",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "X-User-ID",
"in": "header",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "Admin created",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AdminRelationship"
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
}
}
},
"delete": {
"summary": "Delete admin relationship between two persons",
"operationId": "deleteAdminRelationship",
"parameters": [
{
"name": "id1",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "id2",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "X-User-ID",
"in": "header",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "Admin deleted",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/managed_profiles": {
"get": {
"summary": "Get managed profiles",
"operationId": "getManagedProfiles",
"parameters": [
{
"name": "X-User-ID",
"in": "header",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "Managed Profiles retrieved",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"managed": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Admin"
}
}
}
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/recipe/{id}": {
"patch": {
"summary": "Update a recipe by ID",
"operationId": "updateRecipe",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "X-User-ID",
"in": "header",
"required": true,
"schema": {
"type": "integer"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RecipeProperties"
}
}
}
},
"responses": {
"200": {
"description": "Recipe updated",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Recipe"
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
}
}
},
"delete": {
"summary": "Soft delete a recipe by ID",
"operationId": "softDeleteRecipe",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "X-User-ID",
"in": "header",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "Recipe soft deleted"
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/recipe/{id}/hard-delete": {
"delete": {
"summary": "Hard delete a recipe by ID",
"operationId": "hardDeleteRecipe",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "X-User-ID",
"in": "header",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "Recipe hard deleted"
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/recipe/{id}/relationship": {
"post": {
"summary": "Create a relationship with an existing recipe",
"operationId": "createRecipeRelationship",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "X-User-ID",
"in": "header",
"required": true,
"schema": {
"type": "integer"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"id",
"relationship"
],
"properties": {
"id": {
"type": "integer"
},
"relationship": {
"type": "object",
"properties": {
"schema": {
"$ref": "#/components/schemas/LikesProperties"
}
}
}
}
}
}
}
},
"responses": {
"200": {
"description": "Relationship with recipe created",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Likes"
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
}
}
},
"delete": {
"summary": "Delete a relationship with a recipe",
"operationId": "deleteRecipeRelationship",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "personId",
"in": "query",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "X-User-ID",
"in": "header",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "Relationship with recipe deleted"
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"PersonProperties": {
"type": "object",
"properties": {
"invite_code": {
"type": "string",
"nullable": true
},
"google_id": {
"type": "string",
"nullable": true
},
"first_name": {
"type": "string",
"nullable": true
},
"middle_name": {
"type": "string",
"nullable": true
},
"last_name": {
"type": "string",
"nullable": true
},
"titles": {
"type": "array",
"items": {
"type": "string"
},
"nullable": true
},
"suffixes": {
"type": "array",
"items": {
"type": "string"
},
"nullable": true
},
"extra_names": {
"type": "array",
"items": {
"type": "string"
},
"nullable": true
},
"aliases": {
"type": "array",
"items": {
"type": "string"
},
"nullable": true
},
"mothers_first_name": {
"type": "string",
"nullable": true
},
"mothers_last_name": {
"type": "string",
"nullable": true
},
"biological_sex": {
"type": "string",
"enum": [
"male",
"female",
"intersex",
"unknown",
"other"
],
"nullable": true
},
"born": {
"type": "string",
"format": "date",
"nullable": true
},
"place_of_birth": {
"type": "string",
"nullable": true
},
"died": {
"type": "string",
"format": "date",
"nullable": true
},
"place_of_death": {
"type": "string",
"nullable": true
},
"life_events": {
"type": "array",
"items": {
"type": "object",
"properties": {
"from": {
"type": "string",
"format": "date"
},
"to": {
"type": "string",
"format": "date"
},
"description": {
"type": "string"
}
}
},
"nullable": true
},
"occupations": {
"type": "array",
"items": {
"type": "string"
},
"nullable": true
},
"occupation_to_display": {
"type": "string",
"nullable": true
},
"limit": {
"type": "integer",
"nullable": true
},
"photos": {
"type": "array",
"items": {
"type": "object",
"properties": {
"url": {
"type": "string"
},
"description": {
"type": "string"
},
"date": {
"type": "string",
"format": "date"
},
"name": {
"type": "string"
}
}
},
"nullable": true
},
"videos": {
"type": "array",
"items": {
"type": "object",
"properties": {
"url": {
"type": "string"
},
"description": {
"type": "string"
},
"date": {
"type": "string",
"format": "date"
},
"name": {
"type": "string"
}
}
},
"nullable": true
},
"audios": {
"type": "array",
"items": {
"type": "object",
"properties": {
"url": {
"type": "string"
},
"description": {
"type": "string"
},
"date": {
"type": "string",
"format": "date"
},
"name": {
"type": "string"
}
}
},
"nullable": true
},
"profile_picture": {
"type": "string",
"nullable": true
},
"verified": {
"type": "boolean",
"nullable": true
},
"email": {
"type": "string",
"nullable": true
},
"phone": {
"type": "string",
"nullable": true
},
"residence": {
"type": "object",
"properties": {
"city": {
"type": "string"
},
"country": {
"type": "string"
},
"zip_code": {
"type": "string"
},
"address_line_1": {
"type": "string"
},
"address_line_2": {
"type": "string"
}
},
"nullable": true
},
"religion": {
"type": "string",
"nullable": true
},
"baptized": {
"type": "string",
"nullable": true
},
"ideologies": {
"type": "array",
"items": {
"type": "string"
},
"nullable": true
},
"blood_type": {
"type": "string",
"nullable": true
},
"allergies": {
"type": "array",
"items": {
"type": "string"
},
"nullable": true
},
"medications": {
"type": "array",
"nullable": true,
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string",
"nullable": true
},
"components": {
"type": "string",
"nullable": true
},
"dosage": {
"type": "string",
"nullable": true
},
"from": {
"type": "string",
"format": "date",
"nullable": true
},
"to": {
"type": "string",
"format": "date",
"nullable": true
}
}
}
},
"medical_conditions": {
"type": "array",
"items": {
"type": "object"
},
"nullable": true
},
"height": {
"type": "number",
"nullable": true
},
"weight": {
"type": "number",
"nullable": true
},
"hair_colour": {
"type": "string",
"nullable": true
},
"skin_colour": {
"type": "string",
"nullable": true
},
"eye_colour": {
"type": "string",
"nullable": true
},
"sports": {
"type": "array",
"items": {
"type": "string"
},
"nullable": true
},
"hobbies": {
"type": "array",
"items": {
"type": "string"
},
"nullable": true
},
"interests": {
"type": "array",
"items": {
"type": "string"
},
"nullable": true
},
"languages": {
"type": "array",
"items": {
"type": "object",
"properties": {
"language": {
"type": "string"
},
"level": {
"type": "string",
"nullable": true
}
}
},
"nullable": true
},
"notes": {
"type": "array",
"items": {
"type": "object",
"properties": {
"date": {
"type": "string",
"format": "date",
"nullable": true
},
"title": {
"type": "string",
"nullable": true
},
"note": {
"type": "string"
},
"url": {
"type": "string",
"nullable": true
}
}
},
"nullable": true
}
}
},
"PersonRegistration": {
"type": "object",
"required": [
"first_name",
"last_name",
"born",
"limit",
"mothers_first_name",
"mothers_last_name"
],
"properties": {
"first_name": {
"type": "string"
},
"last_name": {
"type": "string"
},
"email": {
"type": "string",
"format": "email",
"nullable": true
},
"limit": {
"type": "integer"
},
"biological_sex": {
"type": "string",
"enum": [
"male",
"female",
"intersex",
"unknown",
"other"
]
},
"born": {
"type": "string",
"format": "date"
},
"mothers_first_name": {
"type": "string"
},
"mothers_last_name": {
"type": "string"
}
}
},
"Person": {
"type": "object",
"properties": {
"Id": {
"type": "integer"
},
"ElementId": {
"type": "string"
},
"Labels": {
"type": "array",
"items": {
"type": "string"
}
},
"Props": {
"$ref": "#/components/schemas/PersonProperties"
}
}
},
"FamilyRelationship": {
"type": "object",
"properties": {
"verified": {
"type": "boolean",
"nullable": true
},
"notes": {
"type": "string",
"nullable": true
},
"from": {
"type": "string",
"format": "date",
"nullable": true
},
"to": {
"type": "string",
"format": "date",
"nullable": true
}
}
},
"Relationship": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"type": {
"type": "string",
"nullable": true
},
"label": {
"type": "string",
"nullable": true
},
"start": {
"type": "integer"
},
"end": {
"type": "integer"
},
"properties": {
"$ref": "#/components/schemas/FamilyRelationship"
}
}
},
"dbtypeRelationship": {
"type": "object",
"properties": {
"Id": {
"type": "integer"
},
"ElementId": {
"type": "string"
},
"Type": {
"type": "string",
"nullable": true
},
"StartId": {
"type": "integer"
},
"StartElementId": {
"type": "string"
},
"EndId": {
"type": "integer"
},
"EndElementId": {
"type": "string"
},
"Props": {
"$ref": "#/components/schemas/FamilyRelationship"
}
}
},
"OptimizedPersonNode": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"labels": {
"type": "array",
"items": {
"type": "string"
}
},
"type": {
"type": "string",
"nullable": true
},
"first_name": {
"type": "string",
"nullable": false
},
"middle_name": {
"type": "string",
"nullable": false
},
"last_name": {
"type": "string",
"nullable": false
},
"born": {
"type": "string",
"format": "date",
"nullable": false
},
"died": {
"type": "string",
"format": "date",
"nullable": true
},
"biological_sex": {
"type": "string",
"enum": [
"male",
"female",
"intersex",
"unknown",
"other"
],
"nullable": true
},
"profile_picture": {
"type": "string",
"nullable": true
}
}
},
"FamilyTree": {
"type": "object",
"properties": {
"people": {
"type": "array",
"items": {
"$ref": "#/components/schemas/OptimizedPersonNode"
}
},
"relationships": {
"type": "array",
"items": {
"$ref": "#/components/schemas/dbtypeRelationship"
}
}
}
},
"RecipeProperties": {
"type": "object",
"properties": {
"name": {
"type": "string",
"nullable": true
},
"origin": {
"type": "string",
"nullable": true
},
"allow_admin_access": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
}
}
}
},
"category": {
"type": "string",
"nullable": true
},
"first_recorded": {
"type": "string",
"format": "date",
"nullable": true
},
"description": {
"type": "string",
"nullable": true
},
"ingredients": {
"type": "array",
"items": {
"type": "string"
},
"nullable": true
},
"instructions": {
"type": "array",
"items": {
"type": "string"
},
"nullable": true
},
"photo": {
"type": "string",
"nullable": true
},
"notes": {
"type": "string",
"nullable": true
},
"others_said": {
"nullable": true,
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"said": {
"type": "string"
}
}
}
}
}
},
"Recipe": {
"type": "object",
"properties": {
"Id": {
"type": "integer"
},
"ElementId": {
"type": "string"
},
"Labels": {
"type": "array",
"items": {
"type": "string"
}
},
"Props": {
"$ref": "#/components/schemas/RecipeProperties"
}
}
},
"Likes": {
"type": "object",
"properties": {
"Id": {
"type": "integer"
},
"Type": {
"type": "string"
},
"StartId": {
"type": "integer"
},
"StartElementId": {
"type": "string"
},
"EndId": {
"type": "integer"
},
"EndElementId": {
"type": "string"
},
"Props": {
"$ref": "#/components/schemas/LikesProperties"
}
}
},
"LikesProperties": {
"type": "object",
"properties": {
"favourite": {
"type": "boolean",
"nullable": true
},
"like_it": {
"type": "boolean",
"nullable": true
},
"could_make_it": {
"type": "boolean",
"nullable": true
}
}
},
"Admin": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"label":{
"type": "array",
"items": {
"type": "string"
}
},
"first_name": {
"type": "string"
},
"adminSince": {
"type": "integer"
},
"last_name": {
"type": "string"
}
}
},
"AdminRelationship": {
"type": "object",
"properties": {
"Id": {
"type": "integer"
},
"Type": {
"type": "string"
},
"StartId": {
"type": "integer"
},
"StartElementId": {
"type": "string"
},
"EndId": {
"type": "integer"
},
"EndElementId": {
"type": "string"
},
"Props": {
"type": "object",
"properties": {
"added": {
"type": "integer"
}
}
}
}
},
"Comment": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"nullable": true
},
"start": {
"type": "integer",
"nullable": true
},
"end": {
"type": "integer",
"nullable": true
},
"type": {
"type": "string",
"nullable": true
},
"label": {
"type": "string",
"nullable": true
},
"props": {
"$ref": "#/components/schemas/Message"
}
}
},
"Message": {
"type": "object",
"properties": {
"message": {
"type": "string"
},
"edited": {
"type": "string",
"format": "date-time",
"nullable": true
},
"sent_at": {
"type": "string",
"format": "date-time"
}
}
},
"Messages": {
"type": "object",
"properties": {
"people": {
"type": "array",
"items": {
"$ref": "#/components/schemas/OptimizedPersonNode"
}
},
"comments": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Comment"
}
}
}
}
}
}
}