title: Prevent Primitive To String Conversion in SpringBoot / Jackson
body: <p>We have written a Springboot Rest Service, it internally uses Jackson for Serialisation / deserialisation of Json input / output of Rest APIs.</p>
  <p>We do not want type conversion of primitives to / from String for API input / output.</p>
  <p>We have disabled String to Primitive conversion using</p>
  <p><code>spring.jackson.mapper.allow-coercion-of-scalars=false</code></p>
  <p>But Primitive to String conversion is still being allowed.</p>
  <p>e.g.</p>
  <p><code>  &quot;name&quot;: 123,</code></p>
  <p>from API is still deserialised to <code>&quot;123&quot;</code>, Java data type of <code>name</code> is <code>String</code> here.</p>
  <p>We have gone through <a href="https://docs.spring.io/spring-boot/docs/current/reference/html/howto.html#howto-customize-the-jackson-objectmapper" rel="nofollow noreferrer">Customize the Jackson ObjectMapper</a> section of Spring Docs and does not look like there is anything in those enums that can be used.</p>
  <p>Is there a way to achieve this without writing a custom ObjectMapper / Deserializer?</p>