swag icon indicating copy to clipboard operation
swag copied to clipboard

swagger.json is generated with invalid JSON (extra comma)

Open ns-mglaske opened this issue 6 months ago • 1 comments

Describe the bug The generated swagger.json output has an additional comma after the info.version key

   1 {
   2     "swagger": "2.0",
   3     "info": {
   4         "description": "Environment status",
   5         "title": "Service Status API",
   6         "contact": {
   7             "name": "Mike Glaske",
   8             "email": "[email protected]"
   9         },
  10         "version": "v0.1.0-0-g53f9fe3",   <- here
  11     },

To Reproduce Steps to reproduce the behavior:

  1. Include version information
  2. Generate JSON swagger output

Expected behavior

   1 {
   2     "swagger": "2.0",
   3     "info": {
   4         "description": "Environment status",
   5         "title": "Service Status API",
   6         "contact": {
   7             "name": "Mike Glaske",
   8             "email": "[email protected]"
   9         },
  10         "version": "v0.1.0-0-g53f9fe3"
  11     },

A clear and concise description of what you expected to happen.

Your swag version v1.16.3

Your go version v1.22.3

ns-mglaske avatar Aug 20 '24 14:08 ns-mglaske