{ "openapi": "3.1.0", "info": { "title": "DEV @olli/backend", "version": "1.0.0" }, "components": { "schemas": {} }, "paths": { "/demo/persons": { "post": { "tags": [ "person" ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "required": [ "first_name", "gender", "metadata" ], "properties": { "first_name": { "type": "string", "minLength": 1 }, "last_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "gender": { "anyOf": [ { "type": "string", "enum": [ "man" ] }, { "type": "string", "enum": [ "woman" ] }, { "type": "string", "enum": [ "other" ] } ] }, "metadata": { "type": "object", "required": [ "login_at", "ip", "agent", "plan" ], "properties": { "login_at": { "type": "string" }, "ip": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "agent": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "plan": { "anyOf": [ { "type": "string", "enum": [ "free" ] }, { "type": "string", "enum": [ "premium" ] } ] } } } } } } }, "required": true }, "responses": { "201": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "first_name", "last_name", "gender", "created_at", "metadata" ], "properties": { "id": { "type": "number" }, "first_name": { "type": "string", "description": "The first name of the person" }, "last_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "gender": { "anyOf": [ { "type": "string", "enum": [ "man" ] }, { "type": "string", "enum": [ "woman" ] }, { "type": "string", "enum": [ "other" ] } ] }, "height": { "type": "number" }, "weight": { "type": "number" }, "created_at": { "type": "string", "format": "date-time" }, "metadata": { "type": "object", "required": [ "login_at", "ip", "agent", "plan" ], "properties": { "login_at": { "type": "string" }, "ip": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "agent": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "plan": { "anyOf": [ { "type": "string", "enum": [ "free" ] }, { "type": "string", "enum": [ "premium" ] } ] } } } } } } } } } }, "get": { "tags": [ "person" ], "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "first_name", "required": false }, { "schema": { "type": "string" }, "in": "query", "name": "last_name", "required": false }, { "schema": { "anyOf": [ { "type": "string", "enum": [ "man" ] }, { "type": "string", "enum": [ "woman" ] }, { "type": "string", "enum": [ "other" ] } ] }, "in": "query", "name": "gender", "required": false } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "required": [ "id", "first_name", "last_name", "gender", "created_at", "metadata" ], "properties": { "id": { "type": "number" }, "first_name": { "type": "string", "description": "The first name of the person" }, "last_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "gender": { "anyOf": [ { "type": "string", "enum": [ "man" ] }, { "type": "string", "enum": [ "woman" ] }, { "type": "string", "enum": [ "other" ] } ] }, "height": { "type": "number" }, "weight": { "type": "number" }, "created_at": { "type": "string", "format": "date-time" }, "metadata": { "type": "object", "required": [ "login_at", "ip", "agent", "plan" ], "properties": { "login_at": { "type": "string" }, "ip": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "agent": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "plan": { "anyOf": [ { "type": "string", "enum": [ "free" ] }, { "type": "string", "enum": [ "premium" ] } ] } } } } } } } } } } } }, "/demo/persons/{id}": { "get": { "tags": [ "person" ], "parameters": [ { "schema": { "type": "number", "minimum": 1 }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "first_name", "last_name", "gender", "created_at", "metadata" ], "properties": { "id": { "type": "number" }, "first_name": { "type": "string", "description": "The first name of the person" }, "last_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "gender": { "anyOf": [ { "type": "string", "enum": [ "man" ] }, { "type": "string", "enum": [ "woman" ] }, { "type": "string", "enum": [ "other" ] } ] }, "height": { "type": "number" }, "weight": { "type": "number" }, "created_at": { "type": "string", "format": "date-time" }, "metadata": { "type": "object", "required": [ "login_at", "ip", "agent", "plan" ], "properties": { "login_at": { "type": "string" }, "ip": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "agent": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "plan": { "anyOf": [ { "type": "string", "enum": [ "free" ] }, { "type": "string", "enum": [ "premium" ] } ] } } } } } } } }, "404": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } } } }, "patch": { "tags": [ "person" ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "first_name": { "type": "string", "minLength": 1 }, "last_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "gender": { "anyOf": [ { "type": "string", "enum": [ "man" ] }, { "type": "string", "enum": [ "woman" ] }, { "type": "string", "enum": [ "other" ] } ] }, "metadata": { "type": "object", "required": [ "login_at", "ip", "agent", "plan" ], "properties": { "login_at": { "type": "string" }, "ip": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "agent": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "plan": { "anyOf": [ { "type": "string", "enum": [ "free" ] }, { "type": "string", "enum": [ "premium" ] } ] } } } } } } } }, "parameters": [ { "schema": { "type": "number", "minimum": 1 }, "in": "path", "name": "id", "required": true } ], "responses": { "204": { "description": "Default Response" }, "404": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } } } }, "delete": { "tags": [ "person" ], "parameters": [ { "schema": { "type": "number", "minimum": 1 }, "in": "path", "name": "id", "required": true } ], "responses": { "204": { "description": "Default Response" }, "404": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } } } } }, "/demo/persons/{id}/with-pets": { "get": { "tags": [ "person" ], "parameters": [ { "schema": { "type": "number", "minimum": 1 }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "first_name", "last_name", "gender", "created_at", "metadata", "pets" ], "properties": { "id": { "type": "number" }, "first_name": { "type": "string" }, "last_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "gender": { "anyOf": [ { "type": "string", "enum": [ "man" ] }, { "type": "string", "enum": [ "woman" ] }, { "type": "string", "enum": [ "other" ] } ] }, "created_at": { "type": "string", "format": "date-time" }, "metadata": { "type": "object", "required": [ "login_at", "ip", "agent", "plan" ], "properties": { "login_at": { "type": "string" }, "ip": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "agent": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "plan": { "anyOf": [ { "type": "string", "enum": [ "free" ] }, { "type": "string", "enum": [ "premium" ] } ] } } }, "pets": { "type": "array", "items": { "type": "object", "required": [ "id", "name", "owner_id", "species" ], "properties": { "id": { "type": "number" }, "name": { "type": "string" }, "owner_id": { "type": "number" }, "species": { "anyOf": [ { "type": "string", "enum": [ "dog" ] }, { "type": "string", "enum": [ "cat" ] } ] } } } } } } } } }, "404": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } } } } }, "/demo/pets": { "post": { "tags": [ "pet" ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "required": [ "name", "owner_id", "species" ], "properties": { "name": { "type": "string", "minLength": 1 }, "owner_id": { "type": "number", "minimum": 1 }, "species": { "anyOf": [ { "type": "string", "enum": [ "dog" ] }, { "type": "string", "enum": [ "cat" ] } ] } } } } }, "required": true }, "responses": { "201": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "name", "owner_id", "species" ], "properties": { "id": { "type": "number" }, "name": { "type": "string" }, "owner_id": { "type": "number" }, "species": { "anyOf": [ { "type": "string", "enum": [ "dog" ] }, { "type": "string", "enum": [ "cat" ] } ] } } } } } } } }, "get": { "tags": [ "pet" ], "parameters": [ { "schema": { "type": "string" }, "in": "query", "name": "name", "required": false }, { "schema": { "type": "number" }, "in": "query", "name": "owner_id", "required": false }, { "schema": { "anyOf": [ { "type": "string", "enum": [ "dog" ] }, { "type": "string", "enum": [ "cat" ] } ] }, "in": "query", "name": "species", "required": false } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "required": [ "id", "name", "owner_id", "species" ], "properties": { "id": { "type": "number" }, "name": { "type": "string" }, "owner_id": { "type": "number" }, "species": { "anyOf": [ { "type": "string", "enum": [ "dog" ] }, { "type": "string", "enum": [ "cat" ] } ] } } } } } } } } } }, "/demo/pets/{id}": { "get": { "tags": [ "pet" ], "parameters": [ { "schema": { "type": "number", "minimum": 1 }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "id", "name", "owner_id", "species" ], "properties": { "id": { "type": "number" }, "name": { "type": "string" }, "owner_id": { "type": "number" }, "species": { "anyOf": [ { "type": "string", "enum": [ "dog" ] }, { "type": "string", "enum": [ "cat" ] } ] } } } } } }, "404": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } } } }, "patch": { "tags": [ "pet" ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1 }, "owner_id": { "type": "number", "minimum": 1 }, "species": { "anyOf": [ { "type": "string", "enum": [ "dog" ] }, { "type": "string", "enum": [ "cat" ] } ] } } } } } }, "parameters": [ { "schema": { "type": "number", "minimum": 1 }, "in": "path", "name": "id", "required": true } ], "responses": { "204": { "description": "Default Response" }, "404": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } } } }, "delete": { "tags": [ "pet" ], "parameters": [ { "schema": { "type": "number", "minimum": 1 }, "in": "path", "name": "id", "required": true } ], "responses": { "204": { "description": "Default Response" }, "404": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } } } } }, "/demo/pets/{id}/with-owner": { "get": { "tags": [ "pet" ], "parameters": [ { "schema": { "type": "number", "minimum": 1 }, "in": "path", "name": "id", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "pet", "owner" ], "properties": { "pet": { "type": "object", "required": [ "id", "name", "owner_id", "species" ], "properties": { "id": { "type": "number" }, "name": { "type": "string" }, "owner_id": { "type": "number" }, "species": { "anyOf": [ { "type": "string", "enum": [ "dog" ] }, { "type": "string", "enum": [ "cat" ] } ] } } }, "owner": { "type": "object", "required": [ "id", "first_name", "last_name", "gender", "created_at", "metadata" ], "properties": { "id": { "type": "number" }, "first_name": { "type": "string", "description": "The first name of the person" }, "last_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "gender": { "anyOf": [ { "type": "string", "enum": [ "man" ] }, { "type": "string", "enum": [ "woman" ] }, { "type": "string", "enum": [ "other" ] } ] }, "height": { "type": "number" }, "weight": { "type": "number" }, "created_at": { "type": "string", "format": "date-time" }, "metadata": { "type": "object", "required": [ "login_at", "ip", "agent", "plan" ], "properties": { "login_at": { "type": "string" }, "ip": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "agent": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "plan": { "anyOf": [ { "type": "string", "enum": [ "free" ] }, { "type": "string", "enum": [ "premium" ] } ] } } } } } } } } } }, "404": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } } } } } } } }, "/status": { "get": { "tags": [ "status" ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "properties": { "msg": { "type": "string", "example": "Server is up and running fine!" } } } } } }, "5XX": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "properties": { "msg": { "type": "string", "example": "Server is not ready." } } } } } } } } } } }