You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fields in request parameters annotated with @JsonSerialize(using = ToStringSerializer.class) should be marked as their original types.
Current Behavior
Fields in request parameters that are annotated with @JsonSerialize(using = ToStringSerializer.class) are incorrectly marked as strings.
bug from #714#715
Possible Solution
The type conversion to string should only occur when processing response parameters.
Steps to Reproduce
@DatapublicclassSerializerTestModel {
/** * Serialize string to long */@JsonSerialize(using = ToStringSerializer.class)
privateLongid;
}
packagecom.power.doc.controller.json;
importcom.power.common.model.CommonResult;
importcom.power.doc.model.SerializerTestModel;
importorg.springframework.web.bind.annotation.*;
/** * Jackson ToStringSerializer test * * @author yusun 2024/01/30 */@RestController@RequestMapping("/serializer")
publicclassSerializerTestController {
/** * testSerializer * * @param model model */@PostMappingpublicCommonResult<SerializerTestModel> testSerializer(@RequestBodySerializerTestModelmodel) {
returnCommonResult.ok().setResult(model);
}
}
Context
The text was updated successfully, but these errors were encountered:
Your Environment
Expected Behavior
Fields in request parameters annotated with @JsonSerialize(using = ToStringSerializer.class) should be marked as their original types.
Current Behavior
Fields in request parameters that are annotated with @JsonSerialize(using = ToStringSerializer.class) are incorrectly marked as strings.
bug from #714 #715
Possible Solution
The type conversion to string should only occur when processing response parameters.
Steps to Reproduce
Context
The text was updated successfully, but these errors were encountered: