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.
MIT License
2.08k stars 175 forks source link

OpenApi - support for nested objects and more datatypes #184

Closed wastaz closed 4 years ago

wastaz commented 5 years ago

The OpenApi stuff doesnt seem to support some datatypes. For example

public class Actor {
    public long Age { get; set; } // For supporting really old actors
}

will generated the schema as a string.

Nested objects

public class Dog {
    public string Name { get; set; }
}
public class Actor {
    public Dog Pet { get; set; }
}

will also be generated as a string.

jchannon commented 5 years ago

Yup this in progress in #169

jchannon commented 5 years ago

Feel free to pull it and have a play. Seems to cope well for most things but nested types and generics need looking at a bit more

wastaz commented 5 years ago

Ah great! :)

williamhbell commented 4 years ago

A fix was submitted last night that handles generics and nested objects.

jchannon commented 4 years ago

Merged some changes thanks to the fantastic @williamhbell so will close this and please open a new issue if there is a problem