From 64276c29597709a33f2f113d630682ba1e9fc181 Mon Sep 17 00:00:00 2001 From: Boga Sebastian Nicolae Date: Sun, 7 Jul 2024 11:22:48 +0300 Subject: [PATCH] swagger.json in api v0 --- v0/swagger.json | 164 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 164 insertions(+) create mode 100644 v0/swagger.json diff --git a/v0/swagger.json b/v0/swagger.json new file mode 100644 index 0000000..e89de65 --- /dev/null +++ b/v0/swagger.json @@ -0,0 +1,164 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "API for LOCAL ENV of peviitor.ro", + "description": "API documentation", + "version": "1.0" + }, + "servers": [ + { + "url": "http://localhost:8080/api/v0" + } + ], + "paths": { + "/random/": { + "get": { + "tags": ["General"], + "summary": "Get random data", + "responses": { + "200": { + "description": "A random job", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "job": { + "type": "integer" + } + } + } + } + } + } + } + } + }, + "/clean/": { + "post": { + "tags": ["General"], + "summary": "Delete jobs for a company", + "requestBody": { + "description": "Company name", + "required": true, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "company": { + "type": "string" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Deleted jobs successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "/companies/": { + "get": { + "tags": ["General"], + "summary": "Get list of companies", + "parameters": [ + { + "in": "query", + "name": "count", + "schema": { + "type": "boolean" + }, + "description": "Whether to count the number of jobs for each company" + } + ], + "responses": { + "200": { + "description": "Successfully received the list of companies", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "companies": { + "type": "array" + }, + "total": { + "type": "integer" + } + } + } + } + } + } + } + } + }, + "/getuser/": { + "get": { + "tags": ["User"], + "summary": "Get a user by ID", + "parameters": [ + { + "name": "user", + "in": "query", + "required": true, + "description": "The ID of the user", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successfully retrieved the user", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "404": { + "description": "No user found", + "content": {} + }, + "503": { + "description": "Service Unavailable. SOLR server is down or your call to Solr failed", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string" + }, + "code": { + "type": "integer" + } + } + } + } + } + } + } + } + } + } +} \ No newline at end of file