added swagger

This commit is contained in:
Maximilian Baum
2026-04-02 09:36:29 +02:00
parent 8ac8643e6d
commit 88ef8136f3
6 changed files with 1509 additions and 391 deletions

View File

@@ -0,0 +1,244 @@
{
"openapi": "3.0.0",
"info": {
"title": "Stupid APIs",
"version": "1.0.0",
"description": "API Documentation for Stupid APIs"
},
"servers": [
{
"url": "http://localhost:3000/api",
"description": "Local server"
}
],
"paths": {
"/sort": {
"post": {
"summary": "Sorts an array",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"input": {
"type": "array",
"items": {}
}
}
}
}
}
},
"responses": {
"200": {
"description": "Sorted array",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"sortedArray": {
"type": "array",
"items": {}
}
}
}
}
}
}
}
}
},
"/isEven": {
"post": {
"summary": "Checks if number is even",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"input": {
"type": "number"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Success"
}
}
}
},
"/isEven/{number}": {
"get": {
"summary": "Checks if number is even",
"parameters": [
{
"name": "number",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Success"
}
}
}
},
"/isOdd": {
"post": {
"summary": "Checks if number is odd",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"input": {
"type": "number"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Success"
}
}
}
},
"/isOdd/{number}": {
"get": {
"summary": "Checks if number is odd",
"parameters": [
{
"name": "number",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Success"
}
}
}
},
"/isNumber": {
"post": {
"summary": "Checks if input is a number",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"input": {}
}
}
}
}
},
"responses": {
"200": {
"description": "Success"
}
}
}
},
"/isNumber/{number}": {
"get": {
"summary": "Checks if param is a number",
"parameters": [
{
"name": "number",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Success"
}
}
}
},
"/toString": {
"post": {
"summary": "Converts input to string",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"input": {}
}
}
}
}
},
"responses": {
"200": {
"description": "Success"
}
}
}
},
"/stringSplit": {
"post": {
"summary": "Splits a string",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"input": {
"type": "object",
"properties": {
"string": {
"type": "string"
},
"seperator": {
"type": "string"
}
}
}
}
}
}
}
},
"responses": {
"200": {
"description": "Success"
}
}
}
}
}
}