{ "openapi": "3.1.0", "info": { "title": "API Documentation", "description": "This is the API documentation for wisheskeeper", "version": "1.0" }, "servers": [ { "url": "http://localhost:8080", "description": "Generated server url" } ], "paths": { "/api/user/{id}/wishes/{wishId}/replace": { "put": { "tags": [ "user-controller" ], "operationId": "replaceUserWish", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "wishId", "in": "path", "required": true, "schema": { "type": "integer", "format": "int64" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WishCreateRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "*/*": { "schema": { "$ref": "#/components/schemas/UserResponse" } } } } } } }, "/api/user/{id}/wishes/{wishId}/fulfill": { "post": { "tags": [ "user-controller" ], "operationId": "fulfillUserWish", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "wishId", "in": "path", "required": true, "schema": { "type": "integer", "format": "int64" } } ], "responses": { "200": { "description": "OK", "content": { "*/*": { "schema": { "$ref": "#/components/schemas/TokenResponse" } } } } } } }, "/api/user/{id}/wishes/add": { "post": { "tags": [ "user-controller" ], "operationId": "addUserWish", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer", "format": "int64" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WishCreateRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "*/*": { "schema": { "$ref": "#/components/schemas/UserResponse" } } } } } } }, "/api/user/create": { "post": { "tags": [ "user-controller" ], "operationId": "createUser", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserCreateRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "*/*": { "schema": { "$ref": "#/components/schemas/UserResponse" } } } } } } }, "/api/user/{id}/update": { "patch": { "tags": [ "user-controller" ], "operationId": "updateUser", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer", "format": "int64" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserUpdateRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "*/*": { "schema": { "$ref": "#/components/schemas/UserResponse" } } } } } } }, "/health/status": { "get": { "tags": [ "healt-check-controller" ], "operationId": "checkHealth", "responses": { "200": { "description": "OK", "content": { "*/*": { "schema": { "$ref": "#/components/schemas/HealthCheckResponse" } } } } } } }, "/api/wish/{id}/token/get": { "get": { "tags": [ "wish-controller" ], "operationId": "getToken", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer", "format": "int64" } } ], "responses": { "200": { "description": "OK", "content": { "*/*": { "schema": { "$ref": "#/components/schemas/TokenResponse" } } } } } } }, "/api/wish/{id}/get": { "get": { "tags": [ "wish-controller" ], "operationId": "get", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer", "format": "int64" } } ], "responses": { "200": { "description": "OK", "content": { "*/*": { "schema": { "$ref": "#/components/schemas/WishResponse" } } } } } } }, "/api/wish/get": { "get": { "tags": [ "wish-controller" ], "operationId": "getAll", "responses": { "200": { "description": "OK", "content": { "*/*": { "schema": { "$ref": "#/components/schemas/WishListResponse" } } } } } } }, "/api/user/{id}/get": { "get": { "tags": [ "user-controller" ], "operationId": "getUser", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer", "format": "int64" } } ], "responses": { "200": { "description": "OK", "content": { "*/*": { "schema": { "$ref": "#/components/schemas/UserResponse" } } } } } } } }, "components": { "schemas": { "WishCreateRequest": { "type": "object", "properties": { "productName": { "type": "string" }, "quantity": { "type": "integer", "format": "int32" } } }, "GeoLocation": { "type": "object", "properties": { "latitude": { "type": "number", "format": "double" }, "longitude": { "type": "number", "format": "double" } } }, "User": { "type": "object", "properties": { "id": { "type": "string" }, "firstName": { "type": "string" }, "lastName": { "type": "string" }, "birthDate": { "type": "string", "format": "date" }, "behaviour": { "type": "string", "enum": [ "NAUGHTY", "NICE" ] }, "location": { "$ref": "#/components/schemas/GeoLocation" }, "favouriteDrink": { "type": "string" }, "wishes": { "type": "array", "items": { "$ref": "#/components/schemas/Wish" } } } }, "UserResponse": { "type": "object", "properties": { "user": { "$ref": "#/components/schemas/User" } } }, "Wish": { "type": "object", "properties": { "id": { "type": "string" }, "productName": { "type": "string" }, "quantity": { "type": "integer", "format": "int32" }, "wishStatus": { "type": "string", "enum": [ "PENDING", "FULFILLED" ] } } }, "TokenResponse": {}, "UserCreateRequest": { "type": "object", "properties": { "firstName": { "type": "string" }, "lastName": { "type": "string" }, "birthDate": { "type": "string", "format": "date" }, "behaviour": { "type": "string", "enum": [ "NAUGHTY", "NICE" ] }, "location": { "$ref": "#/components/schemas/GeoLocation" }, "favouriteDrink": { "type": "string" } }, "required": [ "behaviour", "birthDate", "firstName", "lastName", "location" ] }, "UserUpdateRequest": { "type": "object", "properties": { "firstName": { "type": "string" }, "lastName": { "type": "string" }, "birthDate": { "type": "string", "format": "date" }, "behaviour": { "type": "string", "enum": [ "NAUGHTY", "NICE" ] }, "location": { "$ref": "#/components/schemas/GeoLocation" }, "favouriteDrink": { "type": "string" } } }, "HealthCheckResponse": { "type": "object", "properties": { "healthy": { "type": "boolean" } } }, "WishResponse": {}, "WishListResponse": { "type": "object", "properties": { "wishes": { "type": "array", "items": { "$ref": "#/components/schemas/Wish" } } } } } } }