Skip to content

Jackson mapper default property inclusion should be "ALWAYS" to prevent null values from being omitted in query results #135

@bsara

Description

@bsara

Currently, the object mapper created using ObjectMapperProvider & ObjectMapperConfigurer is unchanged before use. This includes the default property inclusion value of the ObjectMapper. It would never make sense to not have this value be anything other than JsonInclude.Include.ALWAYS since GraphQL query results are never to omit any requested property regardless of the value of the property.

In a project where both RESTful endpoints and GraphQL are used, the situation may arise where the RESTful endpoints are to omit properties from responses under certain conditions (e.g. omit all null values from the response). When this is the case and the project uses the same ObjectMapper for both the RESTful endpoints and the GraphQLServlet, then it would be most helpful to "ignore" the value set by the incoming ObjectMapper's default property inclusion value and set it to JsonInclude.Include.ALWAYS instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions