admin管理员组文章数量:1122846
When sending POST requests with a json body to my Micronaut API it is using Jackson's ObjectMapper to deserialize the json to the DTO.
From what I understood, when excepting a String field, it is trying to parse the next token as a String, and if it fails it converts it to a String anyway. This leads to Numbers and Booleans being converted to Strings.
Is there a way to prevent this? I looked at the JacksonConfiguration and didn't find anything that satisfies this requirement.
I looked at custom Serde implementation but couldn't find a way to validate the token as well.
本文标签:
版权声明:本文标题:serialization - Prevent Micronaut from converting non-string formats to string from request json body properties - Stack Overflo 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736309154a1933915.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论