CarterCommunity / Carter

Carter is framework that is a thin layer of extension methods and functionality over ASP.NET Core allowing code to be more explicit and most importantly more enjoyable.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OpenApi JsonIgnore Support

Dreamwalker666 opened this issue · comments

I think the JsonIgnore attribute should be honored so members marked with this aren't output in the schema.

Now of course this brings in the which serialize scenario! So I propose its stored as an option something like:

Type IgnoreAttribute { get; set; } = typeof(System.Text.Json.Serialization.JsonIgnoreAttribute);

(And of course defaulting to .NET core inbuilt)

Now this does mean original behavior can be achieved by setting the setting to null as well. And also means Json.NET can be supported by swapping the value.

Another options is as standard its set to null and you have to opt into members being ignored