OpenAPITools / OpenAPITools/openapi-generator

[REQ] [Java] [Spring] Logging Spring WebClient calls

Open
#9,352 1 comment 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.

In a Spring context, the generated client code is based on WebClient. In case of we need to log the http request/response with header and body, the solution is to modify the code which build WebClient. You can see the details in this thread :
https://www.baeldung.com/spring-log-webclient-calls

Describe the solution you'd like

Is it possible that the code generated around the WebClient integrates this need and that the only thing to do if we want to trace the http requests is to configure our application ?

One of the difficulties I see is that the code to enable http traces is different depending on the jetty or netty server.

Describe alternatives you've considered

Additional context

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 reviewing the generated Spring WebClient client code and the linked Baeldung discussion, then compare how request and response tracing differs between Jetty and Netty. Done means application configuration can enable HTTP request and response logging, including headers and bodies, without modifying generated client code.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.