Skip to content

[BUG][GO-GIN-SERVER] Conflict route #3546

Open
@boskiv

Description

@boskiv

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • What's the version of OpenAPI Generator used?
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
Description

Server can't start after generation

[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
 - using env:   export GIN_MODE=release
 - using code:  gin.SetMode(gin.ReleaseMode)

[GIN-debug] GET    /v2/                      --> pet-server/go.Index (3 handlers)
[GIN-debug] POST   /v2/pet                   --> pet-server/go.AddPet (3 handlers)
[GIN-debug] DELETE /v2/pet/:petId            --> pet-server/go.DeletePet (3 handlers)
[GIN-debug] GET    /v2/pet/findByStatus      --> pet-server/go.FindPetsByStatus (3 handlers)
[GIN-debug] GET    /v2/pet/findByTags        --> pet-server/go.FindPetsByTags (3 handlers)
[GIN-debug] GET    /v2/pet/:petId            --> pet-server/go.GetPetById (3 handlers)
panic: wildcard route ':petId' conflicts with existing children in path '/v2/pet/:petId'

openapi-generator version
➜  personal openapi-generator version
4.0.3
OpenAPI declaration file content or url
➜  personal wget https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml
Command line used for generation
➜  personal openapi-generator generate -i petstore.yaml -g go-gin-server -o pet-server
Steps to reproduce
docker build -t pet-server:local .
docker run --rm pet-server:local

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