swagger-api / swagger-api/swagger-codegen-generators

Cxf: use jackson annotation for generated interface

Open
#1,048 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
299
Forks
439
PR merge metrics
No merged PRs in 30d

Description

Hi,

Currently, the cxf generator does not support jackson annotation for interfaces leading to deserialization issues at runtime when dealing with oneOf modelisation.
Therefore, I propose you a PR to fix this problem.

Any feedback will be appreciated,
I also leave here some improvements if someone has time to enhance the cxf generator:

  • The property in the @JsonTypeInfo is hardcoded, you can make it dynamic and equals to the discriminator if one is present
  • The SubTypes name value is always equals to the classname, make it equals to the value of mapping if a mapping is defined
    Thanks for taking the time

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 with the CXF generator and the templates or entry points that produce interfaces; no specific file or test is named in the issue. Check how Jackson annotations are currently emitted for oneOf models, then verify that generated interfaces support the reported runtime deserialization case.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.