Skip to content

'@ID' tags are not properly validated for uniqueness #865

@sreya

Description

@sreya

Describe the bug

Two routes with the same path may share an ID without an error being thrown. This is because the map holding
paths will be overwritten with the latest route see here

To Reproduce
Create two endpoints that have the same path. For example

// @ID duplicate-id
// @Router /api/foo/{id} [get]
// @ID duplicate-id
// @Router /api/foo/{id} [delete]

Expected behavior
No two routes should be able to share an ID.

Your swag version
e.g. 1.7.0

Your go version
go version go1.15.6 linux/amd64

Desktop (please complete the following information):

  • OS: [linux]
  • Browser: [chrome]
  • Version: [22]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions