0

I have a DTO that contains several string properties.

None of them are string? but swagger somehow descript them as nullable: true.

This is a DTO for serialization so I do not want to annotate them with [Require]

Can I annotate them as not nullable without annotating them as Require?

Persk
  • 639
  • 2
  • 6
  • 15
  • Does this answer your question? [Mark strings as non-nullable in ASP.NET Core 3.0 Swagger](https://stackoverflow.com/q/58299772/113116) – Helen Jan 15 '21 at 07:25
  • @Helen I dunno, They use Newtonsoft.Json but I'm using System.Text.Json and my config and annotation are already based on it. – Persk Jan 15 '21 at 07:57

0 Answers0