110 lines
2.2 KiB
JSON
110 lines
2.2 KiB
JSON
{
|
|
"openapi": "3.0.1",
|
|
"info": {
|
|
"title": "RpgRoller API",
|
|
"version": "1.0.0"
|
|
},
|
|
"paths": {
|
|
"/api/health": {
|
|
"get": {
|
|
"operationId": "getHealth",
|
|
"responses": {
|
|
"200": {
|
|
"description": "API is reachable.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/HealthResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/roll/{sides}": {
|
|
"get": {
|
|
"operationId": "rollDice",
|
|
"parameters": [
|
|
{
|
|
"name": "sides",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"minimum": 2,
|
|
"maximum": 1000
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Roll succeeded.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/RollResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Validation error.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ApiError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"components": {
|
|
"schemas": {
|
|
"HealthResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"status": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"status"
|
|
]
|
|
},
|
|
"RollResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"sides": {
|
|
"type": "integer",
|
|
"format": "int32"
|
|
},
|
|
"value": {
|
|
"type": "integer",
|
|
"format": "int32"
|
|
}
|
|
},
|
|
"required": [
|
|
"sides",
|
|
"value"
|
|
]
|
|
},
|
|
"ApiError": {
|
|
"type": "object",
|
|
"properties": {
|
|
"error": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"error"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|