update swagger docs
All checks were successful
Release and Deploy / build (push) Successful in 2m16s
Release and Deploy / deploy (push) Successful in 25s

This commit is contained in:
Fran Jurmanović
2025-08-05 14:32:37 +02:00
parent 56c51e5d02
commit ac61ba5223
8 changed files with 1584 additions and 594 deletions

View File

@@ -9,7 +9,7 @@
"title": "ACC Server Manager API",
"contact": {
"name": "ACC Server Manager Support",
"url": "https://github.com/yourusername/acc-server-manager"
"url": "https://github.com/FJurmanovic/acc-server-manager"
},
"license": {
"name": "MIT",
@@ -17,202 +17,10 @@
},
"version": "1.0"
},
"host": "localhost:3000",
"host": "https://acc.jurmanovic.com",
"basePath": "/api/v1",
"paths": {
"/auth/login": {
"post": {
"description": "Authenticate a user and receive a JWT token",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Authentication"
],
"summary": "User login",
"parameters": [
{
"description": "Login credentials",
"name": "credentials",
"in": "body",
"required": true,
"schema": {
"type": "object",
"properties": {
"password": {
"type": "string"
},
"username": {
"type": "string"
}
}
}
}
],
"responses": {
"200": {
"description": "JWT token",
"schema": {
"type": "object",
"properties": {
"token": {
"type": "string"
}
}
}
},
"400": {
"description": "Invalid request body",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"401": {
"description": "Invalid credentials",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
}
},
"/membership": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get a list of all registered users",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User Management"
],
"summary": "List all users",
"responses": {
"200": {
"description": "List of users",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/model.User"
}
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"403": {
"description": "Insufficient permissions",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Create a new user account with specified role",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User Management"
],
"summary": "Create a new user",
"parameters": [
{
"description": "User details",
"name": "user",
"in": "body",
"required": true,
"schema": {
"type": "object",
"properties": {
"password": {
"type": "string"
},
"role": {
"type": "string"
},
"username": {
"type": "string"
}
}
}
}
],
"responses": {
"200": {
"description": "Created user details",
"schema": {
"$ref": "#/definitions/model.User"
}
},
"400": {
"description": "Invalid request body",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"403": {
"description": "Insufficient permissions",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"409": {
"description": "User already exists",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
}
},
"/server": {
"/v1/api/server": {
"get": {
"security": [
{
@@ -303,6 +111,111 @@
}
}
},
"/v1/auth/login": {
"post": {
"description": "Authenticate a user and receive a JWT token",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Authentication"
],
"summary": "User login",
"parameters": [
{
"description": "Login credentials",
"name": "credentials",
"in": "body",
"required": true,
"schema": {
"type": "object",
"properties": {
"password": {
"type": "string"
},
"username": {
"type": "string"
}
}
}
}
],
"responses": {
"200": {
"description": "JWT token",
"schema": {
"type": "object",
"properties": {
"token": {
"type": "string"
}
}
}
},
"400": {
"description": "Invalid request body",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"401": {
"description": "Invalid credentials",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
}
},
"/v1/auth/me": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get details of the currently authenticated user",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Authentication"
],
"summary": "Get current user details",
"responses": {
"200": {
"description": "Current user details",
"schema": {
"$ref": "#/definitions/model.User"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"404": {
"description": "User not found",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
}
},
"/v1/lookup/car-models": {
"get": {
"security": [
@@ -567,6 +480,361 @@
}
}
},
"/v1/membership": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get a list of all registered users",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User Management"
],
"summary": "List all users",
"responses": {
"200": {
"description": "List of users",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/model.User"
}
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"403": {
"description": "Insufficient permissions",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Create a new user account with specified role",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User Management"
],
"summary": "Create a new user",
"parameters": [
{
"description": "User details",
"name": "user",
"in": "body",
"required": true,
"schema": {
"type": "object",
"properties": {
"password": {
"type": "string"
},
"role": {
"type": "string"
},
"username": {
"type": "string"
}
}
}
}
],
"responses": {
"200": {
"description": "Created user details",
"schema": {
"$ref": "#/definitions/model.User"
}
},
"400": {
"description": "Invalid request body",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"403": {
"description": "Insufficient permissions",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"409": {
"description": "User already exists",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
}
},
"/v1/membership/roles": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get a list of all available user roles",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User Management"
],
"summary": "Get all roles",
"responses": {
"200": {
"description": "List of roles",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/model.Role"
}
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"403": {
"description": "Insufficient permissions",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
}
},
"/v1/membership/{id}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get detailed information about a specific user",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User Management"
],
"summary": "Get user by ID",
"parameters": [
{
"type": "string",
"description": "User ID (UUID format)",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "User details",
"schema": {
"$ref": "#/definitions/model.User"
}
},
"400": {
"description": "Invalid user ID format",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"404": {
"description": "User not found",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
},
"put": {
"security": [
{
"BearerAuth": []
}
],
"description": "Update user details by ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User Management"
],
"summary": "Update user",
"parameters": [
{
"type": "string",
"description": "User ID (UUID format)",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Updated user details",
"name": "user",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/service.UpdateUserRequest"
}
}
],
"responses": {
"200": {
"description": "Updated user details",
"schema": {
"$ref": "#/definitions/model.User"
}
},
"400": {
"description": "Invalid request body or ID format",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"403": {
"description": "Insufficient permissions",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"404": {
"description": "User not found",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
},
"delete": {
"security": [
{
"BearerAuth": []
}
],
"description": "Delete a specific user by ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User Management"
],
"summary": "Delete user",
"parameters": [
{
"type": "string",
"description": "User ID (UUID format)",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"description": "User successfully deleted"
},
"400": {
"description": "Invalid user ID format",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"403": {
"description": "Insufficient permissions",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"404": {
"description": "User not found",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
}
},
"/v1/server": {
"get": {
"security": [
@@ -852,6 +1120,71 @@
}
}
}
},
"delete": {
"security": [
{
"BearerAuth": []
}
],
"description": "Delete an existing ACC server",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Server"
],
"summary": "Delete an ACC server",
"parameters": [
{
"type": "string",
"description": "Server ID (UUID format)",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Deleted server details",
"schema": {
"type": "object"
}
},
"400": {
"description": "Invalid server data or ID",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"403": {
"description": "Insufficient permissions",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"404": {
"description": "Server not found",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
}
},
"/v1/server/{id}/config": {
@@ -1084,27 +1417,7 @@
}
}
},
"/v1/service-control": {
"get": {
"description": "Return service control status",
"tags": [
"service-control"
],
"summary": "Return service control status",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
},
"/v1/service-control/restart": {
"/v1/server/{id}/service/restart": {
"post": {
"security": [
{
@@ -1183,7 +1496,7 @@
}
}
},
"/v1/service-control/start": {
"/v1/server/{id}/service/start": {
"post": {
"security": [
{
@@ -1268,7 +1581,7 @@
}
}
},
"/v1/service-control/stop": {
"/v1/server/{id}/service/stop": {
"post": {
"security": [
{
@@ -1353,7 +1666,7 @@
}
}
},
"/v1/service-control/{service}": {
"/v1/server/{id}/service/{service}": {
"get": {
"security": [
{
@@ -1461,6 +1774,26 @@
}
}
}
},
"/v1/system/health": {
"get": {
"description": "Return service control status",
"tags": [
"system"
],
"summary": "Return service control status",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
},
"definitions": {
@@ -1615,6 +1948,20 @@
"type": "string"
}
}
},
"service.UpdateUserRequest": {
"type": "object",
"properties": {
"password": {
"type": "string"
},
"roleId": {
"type": "string"
},
"username": {
"type": "string"
}
}
}
},
"securityDefinitions": {