Feat: add swagger notes
This commit is contained in:
230
docs/docs.go
230
docs/docs.go
@@ -19,13 +19,51 @@ const docTemplate = `{
|
||||
"host": "{{.Host}}",
|
||||
"basePath": "{{.BasePath}}",
|
||||
"paths": {
|
||||
"/api/images": {
|
||||
"/api/alias-update": {
|
||||
"get": {
|
||||
"description": "get update notification using websocket",
|
||||
"summary": "Get notification when alias update",
|
||||
"responses": {}
|
||||
}
|
||||
},
|
||||
"/api/alias/{id}": {
|
||||
"delete": {
|
||||
"description": "delete alias along with the links",
|
||||
"summary": "Delete alias",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "Alias Id",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK"
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized"
|
||||
},
|
||||
"404": {
|
||||
"description": "Not Found"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/aliases": {
|
||||
"get": {
|
||||
"description": "get alias ids and names",
|
||||
"summary": "Get aliases",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/api.getImagesOutputImage"
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/api.getAliasesOutputAlias"
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
@@ -36,9 +74,177 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/image": {
|
||||
"post": {
|
||||
"consumes": [
|
||||
"image/png",
|
||||
"image/jpeg",
|
||||
"image/gif"
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "userinfo from /auth/gen-login-url",
|
||||
"name": "userinfo",
|
||||
"in": "header",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK"
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/image/{id}": {
|
||||
"delete": {
|
||||
"description": "delete image along with the links",
|
||||
"summary": "Delete image",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "Image Id",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK"
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized"
|
||||
},
|
||||
"404": {
|
||||
"description": "Not Found"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/image/{id}/aliases": {
|
||||
"put": {
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "Image Id",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"description": "Payload",
|
||||
"name": "payload",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK"
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized"
|
||||
},
|
||||
"404": {
|
||||
"description": "Not Found"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/images": {
|
||||
"get": {
|
||||
"parameters": [
|
||||
{
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer"
|
||||
},
|
||||
"collectionFormat": "csv",
|
||||
"description": "Image Ids",
|
||||
"name": "images",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer"
|
||||
},
|
||||
"collectionFormat": "csv",
|
||||
"description": "Alias Ids",
|
||||
"name": "aliases",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/api.getImagesOutputImage"
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request"
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/auth/gen-login-url": {
|
||||
"post": {
|
||||
"parameters": [
|
||||
{
|
||||
"description": "Payload",
|
||||
"name": "payload",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/auth.postGenLoginUrlInput"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Payload",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/auth.postGenLoginUrlOutput"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
"api.getAliasesOutputAlias": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "integer"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"api.getImagesOutputImage": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -51,10 +257,26 @@ const docTemplate = `{
|
||||
"id": {
|
||||
"type": "integer"
|
||||
},
|
||||
"uploaded_at": {
|
||||
"uploadedAt": {
|
||||
"type": "integer"
|
||||
},
|
||||
"uploaded_user_id": {
|
||||
"uploadedUserId": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"auth.postGenLoginUrlInput": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"userId": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"auth.postGenLoginUrlOutput": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"loginUrl": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user