{ "openapi": "3.1.0", "info": { "title": "calendar", "description": "", "license": { "name": "" }, "version": "0.1.0" }, "paths": { "/auth/me": { "get": { "tags": [ "crate::handlers::auth" ], "operationId": "me", "responses": { "200": { "description": "Current user profile", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CurrentUser" } } } }, "401": { "description": "Unauthorized" } }, "security": [ { "oidc": [] } ] } }, "/events": { "get": { "tags": [ "crate::handlers::event" ], "operationId": "list_events", "parameters": [ { "name": "upcoming", "in": "query", "required": false, "schema": { "type": [ "boolean", "null" ] } } ], "responses": { "200": { "description": "List of events", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Model" } } } } }, "401": { "description": "Unauthorized" } }, "security": [ { "oidc": [] } ] }, "post": { "tags": [ "crate::handlers::event" ], "operationId": "create_event", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateEventRequest" } } }, "required": true }, "responses": { "200": { "description": "Event created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Model" } } } }, "400": { "description": "Invalid request payload" }, "401": { "description": "Unauthorized" } }, "security": [ { "oidc": [] } ] } }, "/events/{id}": { "get": { "tags": [ "crate::handlers::event" ], "operationId": "get_event", "parameters": [ { "name": "id", "in": "path", "description": "Event database id", "required": true, "schema": { "type": "integer", "format": "int32" } } ], "responses": { "200": { "description": "Event details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Model" } } } }, "401": { "description": "Unauthorized" }, "404": { "description": "Event not found" } }, "security": [ { "oidc": [] } ] }, "put": { "tags": [ "crate::handlers::event" ], "operationId": "update_event", "parameters": [ { "name": "id", "in": "path", "description": "Event database id", "required": true, "schema": { "type": "integer", "format": "int32" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateEventRequest" } } }, "required": true }, "responses": { "200": { "description": "Event updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Model" } } } }, "400": { "description": "Invalid request payload" }, "401": { "description": "Unauthorized" }, "404": { "description": "Event not found" } }, "security": [ { "oidc": [] } ] }, "delete": { "tags": [ "crate::handlers::event" ], "operationId": "delete_event", "parameters": [ { "name": "id", "in": "path", "description": "Event database id", "required": true, "schema": { "type": "integer", "format": "int32" } } ], "responses": { "204": { "description": "Event deleted successfully" }, "401": { "description": "Unauthorized" }, "404": { "description": "Event not found" } }, "security": [ { "oidc": [] } ] } }, "/service/v1/events": { "get": { "tags": [ "crate::handlers::service" ], "operationId": "service_list_events", "parameters": [ { "name": "user_id", "in": "query", "required": false, "schema": { "type": [ "integer", "null" ], "format": "int32" } }, { "name": "upcoming", "in": "query", "required": false, "schema": { "type": [ "boolean", "null" ] } } ], "responses": { "200": { "description": "List of events", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Model" } } } } }, "401": { "description": "Unauthorized" } }, "security": [ { "oidc": [] } ] }, "post": { "tags": [ "crate::handlers::service" ], "operationId": "service_create_event", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceCreateEventRequest" } } }, "required": true }, "responses": { "200": { "description": "Event created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Model" } } } }, "400": { "description": "Invalid request payload" }, "401": { "description": "Unauthorized" } }, "security": [ { "oidc": [] } ] } }, "/service/v1/events/{id}": { "get": { "tags": [ "crate::handlers::service" ], "operationId": "service_get_event", "parameters": [ { "name": "id", "in": "path", "description": "Event database id", "required": true, "schema": { "type": "integer", "format": "int32" } } ], "responses": { "200": { "description": "Event details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Model" } } } }, "401": { "description": "Unauthorized" }, "404": { "description": "Event not found" } }, "security": [ { "oidc": [] } ] }, "put": { "tags": [ "crate::handlers::service" ], "operationId": "service_update_event", "parameters": [ { "name": "id", "in": "path", "description": "Event database id", "required": true, "schema": { "type": "integer", "format": "int32" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceCreateEventRequest" } } }, "required": true }, "responses": { "200": { "description": "Event updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Model" } } } }, "400": { "description": "Invalid request payload" }, "401": { "description": "Unauthorized" }, "404": { "description": "Event not found" } }, "security": [ { "oidc": [] } ] }, "delete": { "tags": [ "crate::handlers::service" ], "operationId": "service_delete_event", "parameters": [ { "name": "id", "in": "path", "description": "Event database id", "required": true, "schema": { "type": "integer", "format": "int32" } } ], "responses": { "204": { "description": "Event deleted successfully" }, "401": { "description": "Unauthorized" }, "404": { "description": "Event not found" } }, "security": [ { "oidc": [] } ] } } }, "components": { "schemas": { "CreateEventRequest": { "type": "object", "required": [ "name", "from", "to" ], "properties": { "from": { "type": "string" }, "name": { "type": "string" }, "to": { "type": "string" } } }, "CurrentUser": { "type": "object", "required": [ "id", "sub", "email", "name" ], "properties": { "email": { "type": "string" }, "id": { "type": "integer", "format": "int32" }, "name": { "type": "string" }, "sub": { "type": "string" } } }, "Model": { "type": "object", "required": [ "id", "name", "from", "to" ], "properties": { "from": { "type": "string", "format": "date-time" }, "id": { "type": "integer", "format": "int64" }, "name": { "type": "string" }, "to": { "type": "string", "format": "date-time" }, "user_id": { "type": [ "integer", "null" ], "format": "int32" } } }, "ServiceCreateEventRequest": { "type": "object", "required": [ "name", "from", "to" ], "properties": { "from": { "type": "string" }, "name": { "type": "string" }, "to": { "type": "string" }, "user_id": { "type": [ "integer", "null" ], "format": "int32" } } } } }, "tags": [ { "name": "calendar", "description": "Calendar Management API" } ] }