swaggo / swag

Automatically generate RESTful API documentation with Swagger 2.0 for Go.
MIT License
10.24k stars 1.17k forks source link

Bad operation when there is a newline character between annotations #1839

Open mariusz-4chain opened 3 weeks ago

mariusz-4chain commented 3 weeks ago

Describe the bug Bad operation when there is a newline character between annotations

To Reproduce Steps to reproduce the behavior:

  1. Add a couple of annotations describing the endpoint
  2. Enter a newline character between the annotations e.g.: // @Router /v1/transaction/record [post]

// @Security x-auth-xpub

  1. Documentation won't be generated or @Tags information is ignored and endpoint is assigned to default tag

Expected behavior If the newline character is not allowed the plugin should throw an error and not silently ignore it.

Screenshots image

Your swag version e.g. 1.16.3

Your go version go1.22.4 linux/amd64

Desktop (please complete the following information):