RicoSuter / NSwag

The Swagger/OpenAPI toolchain for .NET, ASP.NET Core and TypeScript.
http://NSwag.org
MIT License
6.61k stars 1.22k forks source link

Code not generated when SubProperty and/or Enum #4858

Open Kris-I opened 2 months ago

Kris-I commented 2 months ago

Hello,

I have these classes :

public class PagingDto
{
    public int Skip { get; set; }
    public int Take { get; set; }
    List<SortDescriptorDto> Sorts { get; set; } = new();
}
public class SortDescriptorDto
{
    public string Property { get; set; }
    public SortOrderDto? SortOrder { get; set; }
}
public enum SortOrderDto
{
    Ascending,
    Descending
}

In the générated code there are only the properties Skipand Takefrom PagingDto I get only this :

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class PagingDto
{
        [Newtonsoft.Json.JsonProperty("skip", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public int Skip { get; set; } = default!;

        [Newtonsoft.Json.JsonProperty("take", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public int Take { get; set; } = default!;

    }

SortOrderand SortDescriptorDtoare not generated.

Thanks,