From b79280648112c103049ff8768b7b5efcac8e8318 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Thu, 12 Dec 2024 19:17:29 +0100 Subject: [PATCH] docs(swagger): New barcode padding docs --- docs/docs.go | 9 +++++++++ docs/swagger.json | 9 +++++++++ docs/swagger.yaml | 7 +++++++ handlers/barcode.go | 10 +++++----- 4 files changed, 30 insertions(+), 5 deletions(-) diff --git a/docs/docs.go b/docs/docs.go index cfec7ad..981e33c 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -70,6 +70,15 @@ const docTemplate = `{ "description": "Barcode height", "name": "height", "in": "query" + }, + { + "maximum": 100, + "minimum": 0, + "type": "integer", + "default": 10, + "description": "Padding around the barcode (included in image size)", + "name": "padding", + "in": "query" } ], "responses": {} diff --git a/docs/swagger.json b/docs/swagger.json index 58def77..be3525b 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -61,6 +61,15 @@ "description": "Barcode height", "name": "height", "in": "query" + }, + { + "maximum": 100, + "minimum": 0, + "type": "integer", + "default": 10, + "description": "Padding around the barcode (included in image size)", + "name": "padding", + "in": "query" } ], "responses": {} diff --git a/docs/swagger.yaml b/docs/swagger.yaml index f6b8641..aaa25b9 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -190,6 +190,13 @@ paths: minimum: 1 name: height type: integer + - default: 10 + description: Padding around the barcode (included in image size) + in: query + maximum: 100 + minimum: 0 + name: padding + type: integer produces: - image/png responses: {} diff --git a/handlers/barcode.go b/handlers/barcode.go index 0c8ae95..7610005 100644 --- a/handlers/barcode.go +++ b/handlers/barcode.go @@ -11,11 +11,11 @@ import ( // @Summary Generate barcodes // @Description Generate barcodes based on the provided data // @Tags barcodes -// @Param type path string true "Barcode type" Enums(ean13, code128) -// @Param content path string true "Barcode content" MinLength(1) -// @Param width query int false "Barcode width" Minimum(1) Maximum(10000) default(1000) -// @Param height query int false "Barcode height" Minimum(1) Maximum(10000) default(1000) -// @Param padding query int false "Padding around the barcode" Minimum(0) Maximum(100) default(10) +// @Param type path string true "Barcode type" Enums(ean13, code128) +// @Param content path string true "Barcode content" MinLength(1) +// @Param width query int false "Barcode width" Minimum(1) Maximum(10000) default(1000) +// @Param height query int false "Barcode height" Minimum(1) Maximum(10000) default(1000) +// @Param padding query int false "Padding around the barcode (included in image size)" Minimum(0) Maximum(100) default(10) // @Produce image/png // @Router /v1/barcodes/{type}/{content} [get] func (h *DefaultHandler) GenerateBarcode(c *fiber.Ctx) error {