This commit is contained in:
2024-05-09 17:57:32 -05:00
parent a69d2c7a40
commit 5043720f95
10 changed files with 121 additions and 45 deletions

View File

@@ -86,7 +86,7 @@ const docTemplate = `{
"500": {
"description": "error",
"schema": {
"$ref": "#/definitions/model.Message"
"$ref": "#/definitions/stdmodels.StandardError"
}
}
}
@@ -127,7 +127,7 @@ const docTemplate = `{
"500": {
"description": "error",
"schema": {
"$ref": "#/definitions/model.Message"
"$ref": "#/definitions/stdmodels.StandardError"
}
}
}
@@ -168,7 +168,7 @@ const docTemplate = `{
"500": {
"description": "error",
"schema": {
"$ref": "#/definitions/model.Message"
"$ref": "#/definitions/stdmodels.StandardError"
}
}
}
@@ -270,6 +270,23 @@ const docTemplate = `{
"example": "message"
}
}
},
"stdmodels.StandardError": {
"type": "object",
"properties": {
"description": {
"type": "array",
"items": {
"type": "string"
}
},
"message": {
"type": "string"
},
"status": {
"type": "integer"
}
}
}
},
"securityDefinitions": {
@@ -285,7 +302,7 @@ const docTemplate = `{
var SwaggerInfo = &swag.Spec{
Version: "",
Host: "",
BasePath: "/api",
BasePath: "/",
Schemes: []string{},
Title: "DurpAPI",
Description: "API for Durp's needs",

View File

@@ -14,7 +14,7 @@
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
}
},
"basePath": "/api",
"basePath": "/",
"paths": {
"/health/gethealth": {
"get": {
@@ -78,7 +78,7 @@
"500": {
"description": "error",
"schema": {
"$ref": "#/definitions/model.Message"
"$ref": "#/definitions/stdmodels.StandardError"
}
}
}
@@ -119,7 +119,7 @@
"500": {
"description": "error",
"schema": {
"$ref": "#/definitions/model.Message"
"$ref": "#/definitions/stdmodels.StandardError"
}
}
}
@@ -160,7 +160,7 @@
"500": {
"description": "error",
"schema": {
"$ref": "#/definitions/model.Message"
"$ref": "#/definitions/stdmodels.StandardError"
}
}
}
@@ -262,6 +262,23 @@
"example": "message"
}
}
},
"stdmodels.StandardError": {
"type": "object",
"properties": {
"description": {
"type": "array",
"items": {
"type": "string"
}
},
"message": {
"type": "string"
},
"status": {
"type": "integer"
}
}
}
},
"securityDefinitions": {

View File

@@ -1,4 +1,4 @@
basePath: /api
basePath: /
definitions:
model.Message:
properties:
@@ -6,6 +6,17 @@ definitions:
example: message
type: string
type: object
stdmodels.StandardError:
properties:
description:
items:
type: string
type: array
message:
type: string
status:
type: integer
type: object
info:
contact:
email: developerdurp@durp.info
@@ -60,7 +71,7 @@ paths:
"500":
description: error
schema:
$ref: '#/definitions/model.Message'
$ref: '#/definitions/stdmodels.StandardError'
security:
- Authorization: []
summary: Generate dadjoke
@@ -80,7 +91,7 @@ paths:
"500":
description: error
schema:
$ref: '#/definitions/model.Message'
$ref: '#/definitions/stdmodels.StandardError'
security:
- Authorization: []
summary: Get dadjoke
@@ -106,7 +117,7 @@ paths:
"500":
description: error
schema:
$ref: '#/definitions/model.Message'
$ref: '#/definitions/stdmodels.StandardError'
security:
- Authorization: []
summary: Generate dadjoke