swagger-api / swagger-api/swagger-codegen

[JAX-RS] Codegen implicitly assumes first part of URI to be API name

Open
#4,247 0 comments 2 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

Swagger codegen derives API name itself from path object. It implicitly assumes first part of path to be the API name.
for ex: if I have path /parent_resource/{id}/child_resource then Api name is assumed to be ParentResourceApi.

While this is fine for some cases, in microservices world you might have different services for each resource. In our case we have a separate service/API for each child resource, but we still maintain a hierarchical structure and have our uri's that way. It would be very nice to configure api name just like method names are configurable using "operationId".

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 tracing how Swagger codegen derives the API name from the path object in the JAX-RS generator, then compare that behavior with operationId handling. Define how a configurable API name should be supplied for hierarchical paths such as /parent_resource/{id}/child_resource, and verify that generated API names follow the configured value.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, openapi
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.