OpenAPITools / OpenAPITools/openapi-generator
[REQ] Not able to exclude headers as parameters
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Is your feature request related to a problem? Please describe.
We use the Kotlin-Retrofit-Coroutines to generate the sources based on the OpenApi specs. But in our manually generated code-base, we use for the headers OkHttp Interceptors, that way we don't have to supply in each call all the required headers.
But it does not seem to be a way to avoid generating those headers. We tried to download the Retrofit template and remove the {{>headerParams}} block: this ends up not adding the headers but it keeps all the "," for parameters separation:
Describe the solution you'd like
A way to avoid adding the header parameters to the generated endpoints
Describe alternatives you've considered
When manually removing {{>headerParams}} from the template it just works fine without keeping the "," leftovers
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/api.mustache and inspect how headerParams and parameter separators are rendered. Check the generated endpoint output when header parameters are excluded. Done means a supported way to omit those headers without leftover commas or invalid parameter lists.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin
- Domain
- api, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100