swagger-api / swagger-api/swagger-codegen

Feature request: Swagger-codegen to remove a parameters from API interface method signature

Open
#7,957 2 comments 14 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

This is a request to have feature in Swagger-codegen to remove unwanted parameters from API interface method signature. This feature would be useful in scenarios where the REST API service implementation is not directly exposed to client for use but is rather behind some API management platform or API Proxy such as APIGEE. In this case many Header parameters are relevant at the APIGEE(API Proxy) level and would not be passed to backend service layer. Moreover we should not need to removed those Headers from Swagger spec (yaml file) as those are needed at the APIGEE layer.

Additionally, it would be good to have a way to add some custom parameters while generating code using codegen for the same reason as above, where we have introduced some header parameters at APIGEE layer which get passed to REST API Service implementation layer.

With the popularity and increasing usage of API management platforms this feature would be very useful.
Note: This feature request is for the code generated for server side(Service layer) interfaces.

Swagger-codegen version

Any upcoming Swagger-codegen version (I am currently using 2.2.3)

Swagger declaration file content or url

N/A

Command line used for generation

N/A

Steps to reproduce

N/A

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

No files, tests, declaration, command, or generator language are provided. First clarify how server-side interface parameters should be excluded or added and which generator and templates are affected; done should be a defined configuration behavior with an agreed example and verification.

Written by the indexing model from the issue text.

Assessment

Domain
api, tooling
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.