Anand Mohan
Anand Mohan

Reputation: 79

swagger JSON produces null value it stops UI

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
                    }

Upvotes: 1

Views: 962

Answers (1)

fehguy
fehguy

Reputation: 6824

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

Upvotes: 1

Related Questions