Skip to content

[BUG] [Java] [RestClient] Custmized ObjectMapper is Ignored #20111

@antechrestos

Description

@antechrestos

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

Currently with code generated, we are not able to provide a customized objectMapper used during serialization. Indeed, RestClient.Builder builds a default list of converters and then calls the consumer that currently adds the MappingJackson2HttpMessageConverter with the customized ObjectMapper at the end.

openapi-generator version

7.9.0

OpenAPI declaration file content or url

Any one.

Generation Details
Steps to reproduce

Generate any ApiClient with RestClient by providing the ObjectMapper. By breakpoint you can see that the MappingJackson2HttpMessageConverter used during serialization is the one built by default and not the one built by the generated stub.

Suggestion

See MR #20112

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions