swagger-api / swagger-api/swagger-core

AnnotationsUtils should not rely on ObjectMapper

Open
#5,154 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

backlog Feature
Dominant language
Java
Stars
7.5k
Forks
2.3k
Avg merge
18h 1m
Merged PRs (30d)
10

Description

https://github.com/swagger-api/swagger-core/blob/9862c448d3309edf1882cc6649497db50b25a5db/modules/swagger-core/src/main/java/io/swagger/v3/core/util/AnnotationsUtils.java#L1718

It seems kind of weird to me that an ObjectMapper is used to clone the Model here because this can lead to issues if the ObjectMapper is configured differently (e.g. using Mixins) and might break expected behaviour.

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 in modules/swagger-core/src/main/java/io/swagger/v3/core/util/AnnotationsUtils.java around line 1718 and inspect how the Model is cloned. Determine how to avoid dependence on a differently configured ObjectMapper, then verify that cloning preserves the expected behavior without affected Mixins or other mapper configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.