Hello, I have a question about the automatic documentation page.
I have prepared DTO for the request (and the response) using class inheritance, because most of the attributes are common, as in the following example:
[Route("/content/{culture}photos/{id}", "GET", Summary = "GET a photo by id")]
public class PhotoRequest : BaseRequest, IReturn<PhotoResponse>
{
}
which derives from:
[DataContract]
public class BaseRequest: CoreRequest
{
[DataMember(Name = "id")]
[ApiMember(Description = "The ID", ParameterType = "path", IsRequired = true)]
public string Id{ get; set; }
}
and more:
[DataContract]
public class CoreRequest
{
[DataMember(Name = "Culture")]
[ApiMember(Name = "Culture", ParameterType = "path", IsRequired = true, Description = "The culture (e.g.: en-GB)")]
public string Culture { get; set; }
}
In the metatada page (xml / json detail page for example) there are two big issues:
- the PhotoRequest class is missing from the page
- The BaseRequest and CoreRequest classes are present, but without any relations between them, so it is not easy to understand from the consumer of the request
The things do not change marking abstract the two base classes.
The same classes are properly documented on the Swagger page.
Any ideas to solve this issue? Do I have to remove the inheritance and duplicate all the attributes?
Thanks.