Skip to content

Property of type IFormFile is nullable even with NotEmpty rule #131

@icnocop

Description

@icnocop

Hi.

If I have an action which accepts a model decorated with FromForm which contains a property of type IFormFile which has a NotEmpty rule, the OpenAPI schema is generated and unexpectedly has nullable: true on that property.

I expected the property to not be nullable because of the NotEmpty rule.

It may be related to #24

See #130

The unit test in IFormFileTests passes successfully, but when I view the swagger UI or generated swagger.json of the UploadFile action in SampleNSwagWebApi, nullable is set to true.

image

image

Thank you.

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