swagger-api / swagger-api/swagger-codegen

[Jaxrs]Is it possible to use part of the tag value?

Open
#8,415 1 comment 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

Hi Team,

I am integrating my project with the codegen tool. It is all good but for one feature, I am stuck and trying to seek help from you.

Background Description:
The swagger currently scans my entire project and put everything inside one single json file. However, my basic CRUD methods share the same method name and thus the OperationId in json is the same for all of them, which I believe is a violation against the rules as operationId cannot be the same? (Some online editors like restlet reports this as an error).
Also, When testing generation with the json, they are all re-named with a counter number. My current solution is trying to rename my methods with a pattern "get_Foo", so that the operationId will be unique.

Actual question:
The operationId (get_Foo) will goes to {{nickname}} in the api.mustache, is it possible to take only "get" instead of the entire string?

Thanks for the time reading this.

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 with the api.mustache template and trace how the operationId value becomes {{nickname}} during code generation. Check the template syntax and related codegen entry points for supported value transformations, then verify the behavior with a representative CRUD definition whose operationIds use the get_Foo pattern.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.