Decorate AutoQuery QueryResponse with Swagger metadata

Hi,

I was wondering how I would go about to decorate my ResponseDTO from an AutoQuery service with Swagger metadata. For now I have the following AutoQuery request DTO:

    public class FindBookings : QueryBase<BookedEvent, BookedEventResponse>, IJoin<BookedEvent, Resource>

This is decorated just fine, but the response dto called BookedEventResponse will not show a model in the Swagger UI.

   [Description("My event is here")]
   public class BookedEventResponse
   {
      [Description("response dto from")]
      public DateTime From { get; set; }
   }

In Swagger, the model is described as

QueryResponse {}

But I expected something like

QueryResponse<BookedEventResponse> {
  DateTime From
}

or

BookedEventResponse {
  DateTime From
}

I´ve also tried to add descriptions dynamically to the base class but they don’t show either:

typeof(QueryResponse<>)
    .GetProperty("Offset")
    .AddAttributes(new DescriptionAttribute(
     "Describe me"
));

Is this a bug, not implemented or me not understanding?
Thank you

Hi, the AutoQuery Generic Response type should now be emitted from this commit:

This change is available from v4.0.43 that’s now available on MyGet.

Thanks, it seems to work now!

Is it possible to decorate the system specific classes with documentation? I tried the following:

     typeof(ResponseStatus)
        .GetProperty("Message")
        .AddAttributes(new DescriptionAttribute("A human friendly error message"));

But it didn’t show up.

Can you try with the latest v4.0.43 that’s on MyGet, since you already have v4.0.43 installed you’ll need to clear your NuGet package cache to download the latest version.