Files
DurpAPI/docs/swagger.json

290 lines
9.1 KiB
JSON

{
"swagger": "2.0",
"info": {
"description": "API for Durp's needs",
"title": "DurpAPI",
"termsOfService": "http://swagger.io/terms/",
"contact": {
"name": "API Support",
"url": "https://durp.info",
"email": "developerdurp@durp.info"
},
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
}
},
"basePath": "/",
"paths": {
"/health/gethealth": {
"get": {
"security": [
{
"Authorization": []
}
],
"description": "Get the health of the API",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"health"
],
"summary": "Generate Health status",
"responses": {
"200": {
"description": "response",
"schema": {
"$ref": "#/definitions/stdmodels.StandardMessage"
}
},
"500": {
"description": "error",
"schema": {
"$ref": "#/definitions/stdmodels.StandardError"
}
}
}
}
},
"/jokes/dadjoke": {
"get": {
"security": [
{
"Authorization": []
}
],
"description": "get a dad joke",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"DadJoke"
],
"summary": "Get dadjoke",
"responses": {
"200": {
"description": "response",
"schema": {
"$ref": "#/definitions/stdmodels.StandardMessage"
}
},
"500": {
"description": "error",
"schema": {
"$ref": "#/definitions/stdmodels.StandardError"
}
}
}
},
"post": {
"security": [
{
"Authorization": []
}
],
"description": "create a dad joke",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"DadJoke"
],
"summary": "Generate dadjoke",
"parameters": [
{
"type": "string",
"description": "Dad Joke you wish to enter into database",
"name": "joke",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "response",
"schema": {
"$ref": "#/definitions/stdmodels.StandardMessage"
}
},
"500": {
"description": "error",
"schema": {
"$ref": "#/definitions/stdmodels.StandardError"
}
}
}
},
"delete": {
"security": [
{
"Authorization": []
}
],
"description": "create a dad joke",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"DadJoke"
],
"summary": "Generate dadjoke",
"parameters": [
{
"type": "string",
"description": "Dad joke you wish to delete from the database",
"name": "joke",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "response",
"schema": {
"$ref": "#/definitions/stdmodels.StandardMessage"
}
},
"500": {
"description": "error",
"schema": {
"$ref": "#/definitions/stdmodels.StandardError"
}
}
}
}
},
"/openai/general": {
"get": {
"security": [
{
"Authorization": []
}
],
"description": "Ask ChatGPT a general question",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"openai"
],
"summary": "Gerneral ChatGPT",
"parameters": [
{
"type": "string",
"description": "Ask ChatGPT a general question",
"name": "message",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "response",
"schema": {
"$ref": "#/definitions/stdmodels.StandardMessage"
}
},
"500": {
"description": "error",
"schema": {
"$ref": "#/definitions/stdmodels.StandardError"
}
}
}
}
},
"/openai/travelagent": {
"get": {
"security": [
{
"Authorization": []
}
],
"description": "Ask ChatGPT for suggestions as if it was a travel agent",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"openai"
],
"summary": "Travel Agent ChatGPT",
"parameters": [
{
"type": "string",
"description": "Ask ChatGPT for suggestions as a travel agent",
"name": "message",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "response",
"schema": {
"$ref": "#/definitions/stdmodels.StandardMessage"
}
},
"500": {
"description": "error",
"schema": {
"$ref": "#/definitions/stdmodels.StandardError"
}
}
}
}
}
},
"definitions": {
"stdmodels.StandardError": {
"type": "object",
"properties": {
"description": {
"type": "array",
"items": {
"type": "string"
}
},
"message": {
"type": "string"
},
"status": {
"type": "integer"
}
}
},
"stdmodels.StandardMessage": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
}
},
"securityDefinitions": {
"Authorization": {
"type": "apiKey",
"name": "Authorization",
"in": "header"
}
}
}