swagger-api / swagger-api/swagger-codegen

Java template uses an removed method(DeserializationContext.mappingException(String))

Open
#12,461 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

In modules/swagger-codegen/src/main/resources/javaSpring/CustomInstantDeserializer.mustache:Line 203:

throw context.mappingException("Expected type float, integer, or string.");

The com.fasterxml.jackson.databind.DeserializationContext.mappingException(String) is an expired method and has been romoved in jackson-databind:2.16.0.(Swagger-codegen depends on jackson-databind-2.17.0 & CVE-2023-35116 Vulnerabilitiy reported in jackson-databind up to 2.16)

Thanks!

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

Open modules/swagger-codegen/src/main/resources/javaSpring/CustomInstantDeserializer.mustache and inspect line 203 and its use of DeserializationContext.mappingException(String). Compare that call with the supported Jackson API, update the template, and verify that generated Java output builds with jackson-databind 2.17.0.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.