Skip to content

Handling of Required.DisallowNull #336

@mnemcik-visma

Description

@mnemcik-visma

If a property is annotated with [JsonProperty(Required = Required.DisallowNull)], the output openapi schema indicates such field as a required field.

From the description of the DisallowNull: The property is not required but it cannot be a null value.

This in my opinion makes more sense to not mark a particular property required, because in fact it is not required. The meaning of this setting is to make sure to provide a value if the property name is defined, thus more defining the expected parsing behavior & format of the provided json, compared to the actually requiring that field to be present in the json file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions