Api Attribute on operations and the Swagger UI

Hi,
suppose I have a getorder operation routed to /orders GET
and a
placeorder operation routed to /orders POST

I’ve added some comment on the 2 operations using the Api attribute …

When I go to the swagger UI page there is a problem : the swagger UI Group all operations with the same url fragement (/orders) and as comment shows only one of the 2 comments I’ve provided.

Is there a way to have such comments appear each one by its corresponding operation

thank you
enrico sabbadin

Can you please include your annotated DTO’s that repro’s the issue and screenshots of what’s being rendered in Swagger UI? and the version you’re using, e.g v4.0.46.

here are some of the operations sharing the same route … as you can see from the swagger screenshot in the “description” of “AvailabilityHelpers” there is only the one pertaining to the add operation.

best regards
enrico sabbadin

[Route("/availabilityHelpers/{Id}", “GET”)]
[DataContract]
[Api(“Back Office Operation. Return the required (by id) Availability Helper” +
“\nIn the Auth Token there must be a backoffice scope”)]
public class GetAvailabilityHelper : IReturn

[Route("/availabilityHelper", “PUT”)]
[DataContract]
[Api(“Back Office OPeration. Update an Availability Helper” +
“\nIn the Auth Token there must be a backoffice scope”)]
public class UpdateAvailabilityHelper : IReturn

[Route("/availabilityHelpers", “POST”)]
[DataContract]
[Api(“Back Office Operation. Add an Availability Helper” +
“\nIn the Auth Token there must be a backoffice scope”)]
public class AddAvailabilityHelper : IReturn

The description for each should now be included from this commit.

Also when there’s multiple routes sharing the same base path you can specify a summary to cover all of them with the new SwaggerFeature.RouteSummary Dictionary, e.g:

Plugins.Add(new SwaggerFeature {
    RouteSummary = {
        { "/availabilityHelpers", "AvailabilityHelpers Route Summary" }
    }
});

Forgot to mention this is available from v4.0.47 that’s now available on MyGet.

thank you a lot !!

best regards
enrico sabbadin