From f7f0a4951270ae8d5a1fe76a58704908b040b1f8 Mon Sep 17 00:00:00 2001 From: grumbulon Date: Sat, 4 Feb 2023 21:05:39 -0500 Subject: [PATCH] update swagger docs --- docs/docs.go | 52 +------------------------------------------- docs/swagger.json | 52 +------------------------------------------- docs/swagger.yaml | 41 ++++------------------------------ internal/api/zone.go | 5 ++++- 4 files changed, 10 insertions(+), 140 deletions(-) diff --git a/docs/docs.go b/docs/docs.go index 9c7572d..aeb6391 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -62,56 +62,6 @@ const docTemplate = `{ } } }, - "/api/parse": { - "post": { - "security": [ - { - "Bearer": [] - } - ], - "description": "parse your zonefile\nRate limited: 10 requests every 10 second\nyou must specify \"Bearer\" before entering your token", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "tags": [ - "DNS" - ], - "summary": "parse your zonefile", - "parameters": [ - { - "type": "string", - "description": "Zonefile name", - "name": "filename", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "Bearer Token", - "name": "Authorization", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/internal.SwaggerGenericResponse-internal_Response" - } - }, - "500": { - "description": "internalServerError is a 500 server error with a logged error call back", - "schema": { - "$ref": "#/definitions/internal.SwaggerGenericResponse-internal_Response" - } - } - } - } - }, "/api/upload": { "post": { "security": [ @@ -119,7 +69,7 @@ const docTemplate = `{ "Bearer": [] } ], - "description": "upload takes files from the user and stores it locally to be parsed. Uploads are associated with a specific user.\nRate limited: 10 requests every 10 second\nyou must specify \"Bearer\" before entering your token", + "description": "Upload takes a multipart form file as user input. It must not exceede 1 mb and must be of text/plain content type.\nIf a file uploads successfully it will be saved locally and parsed.\nIf parsing is successful pomme will save the file to your ZoneDir defined in your config.\nUploads are associated with a specific user.\nRate limited: 10 requests every 10 second\nyou must specify \"Bearer\" before entering your token", "consumes": [ "multipart/form-data" ], diff --git a/docs/swagger.json b/docs/swagger.json index be72e9e..fc04d4b 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -53,56 +53,6 @@ } } }, - "/api/parse": { - "post": { - "security": [ - { - "Bearer": [] - } - ], - "description": "parse your zonefile\nRate limited: 10 requests every 10 second\nyou must specify \"Bearer\" before entering your token", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "tags": [ - "DNS" - ], - "summary": "parse your zonefile", - "parameters": [ - { - "type": "string", - "description": "Zonefile name", - "name": "filename", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "Bearer Token", - "name": "Authorization", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/internal.SwaggerGenericResponse-internal_Response" - } - }, - "500": { - "description": "internalServerError is a 500 server error with a logged error call back", - "schema": { - "$ref": "#/definitions/internal.SwaggerGenericResponse-internal_Response" - } - } - } - } - }, "/api/upload": { "post": { "security": [ @@ -110,7 +60,7 @@ "Bearer": [] } ], - "description": "upload takes files from the user and stores it locally to be parsed. Uploads are associated with a specific user.\nRate limited: 10 requests every 10 second\nyou must specify \"Bearer\" before entering your token", + "description": "Upload takes a multipart form file as user input. It must not exceede 1 mb and must be of text/plain content type.\nIf a file uploads successfully it will be saved locally and parsed.\nIf parsing is successful pomme will save the file to your ZoneDir defined in your config.\nUploads are associated with a specific user.\nRate limited: 10 requests every 10 second\nyou must specify \"Bearer\" before entering your token", "consumes": [ "multipart/form-data" ], diff --git a/docs/swagger.yaml b/docs/swagger.yaml index ea7667b..7a4e7b2 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -50,48 +50,15 @@ paths: summary: authenticate as a regular user tags: - accounts - /api/parse: - post: - consumes: - - multipart/form-data - description: |- - parse your zonefile - Rate limited: 10 requests every 10 second - you must specify "Bearer" before entering your token - parameters: - - description: Zonefile name - in: query - name: filename - required: true - type: string - - description: Bearer Token - in: header - name: Authorization - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/internal.SwaggerGenericResponse-internal_Response' - "500": - description: internalServerError is a 500 server error with a logged error - call back - schema: - $ref: '#/definitions/internal.SwaggerGenericResponse-internal_Response' - security: - - Bearer: [] - summary: parse your zonefile - tags: - - DNS /api/upload: post: consumes: - multipart/form-data description: |- - upload takes files from the user and stores it locally to be parsed. Uploads are associated with a specific user. + Upload takes a multipart form file as user input. It must not exceede 1 mb and must be of text/plain content type. + If a file uploads successfully it will be saved locally and parsed. + If parsing is successful pomme will save the file to your ZoneDir defined in your config. + Uploads are associated with a specific user. Rate limited: 10 requests every 10 second you must specify "Bearer" before entering your token parameters: diff --git a/internal/api/zone.go b/internal/api/zone.go index 577f6f2..8e516db 100644 --- a/internal/api/zone.go +++ b/internal/api/zone.go @@ -19,7 +19,10 @@ import ( // Upload godoc // // @Summary upload a zonefile -// @Description upload takes files from the user and stores it locally to be parsed. Uploads are associated with a specific user. +// @Description Upload takes a multipart form file as user input. It must not exceede 1 mb and must be of text/plain content type. +// @Description If a file uploads successfully it will be saved locally and parsed. +// @Description If parsing is successful pomme will save the file to your ZoneDir defined in your config. +// @Description Uploads are associated with a specific user. // // @Description Rate limited: 10 requests every 10 second // @Description you must specify "Bearer" before entering your token