1

I am using swaggerspring mvc -1.0.2 and jackson-databind 2.6.3.why it produce null value.how stop it?.it stopping swagger UI. JSON

                    {
                        "parameterType": {
                            "absoluteType": "array"
                        },
                        "name": "file",
                        "description": "Pass File as input",
                        "defaultValue": "",
                        "required": true,
                        "allowMultiple": false,
                        "allowableValues": null,
                        "paramType": "query",
                        "paramAccess": null
                    }
Anand Mohan
  • 79
  • 15

1 Answers1

1

You need to configure your JSON mapper to not write null values:

http://docs.spring.io/spring-boot/docs/current/reference/html/howto-spring-mvc.html#howto-customize-the-jackson-objectmapper

And adding the specific serialization option is like such:

spring.jackson.serialization-inclusion:non_null
fehguy
  • 6,724
  • 25
  • 23