IntelliJ HTTp Client Generates Incorrect BigDecimal Request Body

I came across an inconsistency 🚨 while testing a Spring Boot API using 𝐈𝐧𝐭𝐞𝐥𝐥𝐢𝐉’𝐬 𝐇𝐓𝐓𝐏 𝐜𝐥𝐢𝐞𝐧𝐭 Given a simple DTO like: public record ProductRequest( String name, BigDecimal price ) {} IntelliJ generates the request body as: { "name": "", "price": {} } However, Swagger/OpenAPI correctly represents it as: { "name": "string", "price": 0 } From a Jackson perspective, BigDecimal should map to a numeric value, not an object. Sending {} results in deserialization errors. It looks like IntelliJ is unable to infer BigDecimal properly and defaults to an object type. Requesting the JetBrains team to either: improve type inference for common numeric types like BigDecimal, or clarify the limitation in documentation. This can be misleading when developers rely on generated requests for testing APIs. #SpringBoot #Java #Backend #OpenAPI #Swagger #IntelliJ #BugReport #JetBrains

To view or add a comment, sign in

Explore content categories