OpenAPITools / OpenAPITools/openapi-generator

[REQ] [JAVA] [SPRING] Add a way to pass the content type as a method parameter

Open
#24,106 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature
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.

I use Java and the OpenApi generator to generate classes, that use the SpringBoot resttemplate or restClient to send requests through defined REST-endpoints. These requests can have different bodies and with that different content-types. I can only set the content-type of the request through the definition of the endpoint.

Describe the solution you'd like

I would like an option, that adds a content-type method parameter. With that I can manually set the content-type of the request.

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 locating the Java Spring generator templates and the generated RestTemplate or RestClient request methods, then trace how endpoint content types are currently selected. Done means generated client methods can accept a content-type parameter and use it for requests, with coverage for the affected generation path.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring, spring-boot
Domain
api, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.