{ "openapi": "3.0.0", "paths": { "/authentication/login": { "post": { "summary": "Login with username and password", "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoginRequest" } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoginResponse" } } } }, "401": { "description": "Invalid username or password", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Any other exception", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } }, "tags": [ "Authentication" ] } }, "/authentication/logout": { "post": { "summary": "Logout user", "parameters": [], "responses": { "200": { "description": "OK" }, "500": { "description": "Any other exception", "content": { "application/json": { "schema": { "type": "object", "allOf": [ { "$ref": "#/components/schemas/ErrorResponse" } ] } } } } }, "tags": [ "Authentication" ], "security": [ { "JWT-auth": [] } ] } } }, "info": { "title": "User Authentication Service", "version": "1.0" }, "components": { "securitySchemes": { "JWT-auth": { "scheme": "bearer", "bearerFormat": "JWT", "type": "http" } }, "schemas": { "LoginRequest": { "type": "object", "properties": { "username": { "type": "string", "description": "Login user name", "example": "user1" }, "password": { "type": "string", "description": "User's password", "example": "password" } }, "required": [ "username", "password" ] }, "LoginResponse": { "type": "object", "properties": { "accessToken": { "type": "string", "description": "JWT access token", "example": "abcdefg" } }, "required": [ "accessToken" ] }, "ErrorResponse": { "type": "object", "properties": { "errorCode": { "type": "integer", "description": "Application error code" } }, "required": [ "errorCode" ] } } } }