How to enable 'ALLOW_NUMERIC_LEADING_ZEROS' feature to allow leading zeroes in JSON Request Body?

前端 未结 4 1107

As per JSON specification, I am aware that leading zeroes are not allowed in integers in JSON. But as per Jackson documentation, there is a property in Jackson library i.e.

4条回答
  •  天涯浪人
    2020-12-21 20:09

    Simply put following property on your application.properties file

    spring.jackson.parser.allow-numeric-leading-zeros=true
    

    You can set jackson as default converter by following property if not set default

    spring.http.converters.preferred-json-mapper=jackson
    

提交回复
热议问题