swagger-api / swagger-api/swagger-codegen

How does swagger codegen handle api gateway url routing to different actual service endpoint?

Open
#9,950 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

let's say I'm using spring cloud gateway which is routing url: /api/v1/foo to the actual service endpoint /api/what/the/heck hold by springboot, obviously I need to have path set to /api/v1/foo in the swagger yaml file because this is what is exposing to the user, but that would end in having the generated interface code with @RequestMapping(value="/api/v1/foo") rather than @RequestMapping(value="/api/what/the/heck"), don't ask me why I need to to the route, it's just as it is. What's the standard mechanism to handle this issue?

Swagger-codegen version
Swagger declaration file content or url
Command line used for generation
Steps to reproduce
Related issues/PRs
Suggest a fix/enhancement

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the Swagger YAML path /api/v1/foo with the generated Spring @RequestMapping and the Spring Cloud Gateway route to /api/what/the/heck. Check the project’s Spring server-generation entry points and templates to determine whether route translation is supported; done means documenting or defining a clear mechanism for the two paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
spring, spring-boot
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.