I am trying to use the output from ServiceStacks OpenAPI with dapperdox to automatically generate documentation for my service.
According to the dapperdox Wiki: “DapperDox requires that the optional schema object title member is present. DapperDox uses the title member to give the resource a name in the documentation it produces”
The output produced by ServiceStack does not seem to contain these title objects. Is there something I am missing something or is there some way I can get ServiceStack to add them?
I have the titles now but for the fields inside the request DTO the description is not being output. In my response DTO I am getting the descriptions output. I’m using the [ApiMember(Description="")] on both the request and the response DTO.
The below DTO does not seem to be including descriptions in the OpenAPI.json. I am expecting to see the descrtptions in the output.
Let me know if it would be easier if I give you this in a sample project.
[Api("Find, Create, Update and Delete candidates")]
[Route("/candidate/{CandidateRef}", "GET", Summary = "Get the specified candidate")]
public class CandidateGet : IReturn<CandidateGetResponse>, IProfileGetRequest
{
[ApiMember(Description = "The number of results to SKIP")]
public int Skip { get; set; }
[ApiMember(Description = "The number of results to TAKE (i.e. return). Max 1000", IsRequired = true)]
public int Take { get; set; }
[ApiMember(Description = "GET the candidate with this CandidateRef")]
public Int32 CandidateRef { get; set; }
}
Thanks - I don’t see any change but I’m not sure I’ve got the latest changes. I’ve followed all the instructions to get nuget to reload the packages. I was expecting a new ServiceStack.Api.OpenApi.dll or am I looking in the wrong place?
Did you clear nuget cache? The version of the package is the same 4.5.9, but dll should be changed after clearing nuget cache and reinstalling the package.
If that doesn’t work you can wait for 8-10hrs for the next release when the official NuGet packages will be updated to have a v4.5.10 version which will ignore any cached v4.5.9 MyGet packages.