I’am trying to add a swagger summary to the ServiceStack.GetAccessToken Service with:
GetRouteAttributes(Type.GetType("ServiceStack.GetAccessToken,ServiceStack.Client"))
.Each(r => {
r.Summary = "Refresh an expired token with refreshToken endpoint to get a new JSON Webokens(JWT)";
});
but nothing happens? How can I do that?
Probably there is no RouteAttribute defined for GetAccessToken? Because with:
.AddAttributes(new RouteAttribute("/access-token") {
Summary = "Refresh an expired token with refreshToken endpoint to get a new JSON Web Tokens(JWT)"
});
Please don’t try to re-register or otherwise interfere with the registration of internal services, they’re not overridable. Any customizations should be done using the filters in OpenApiFeature which I’ve provided an example of in one of your earlier questions:
e.g.
Plugins.Add(new OpenApiFeature
{
ApiDeclarationFilter = api =>
{
api.Paths["/access-token"].Get.Summary = "My GetAccessToken Summary";
},
});
Yes but I have already added a “/access-token” description and summary for my OpenAPI Schema but we also use the ServiceStack Swagger UI which uses OpenAPI 1.2 (“swaggerVersion”:“1.2”) means the SStack Swagger UI will get the meta information by the /resources enpoint and I need also the summary in the Swagger UI?
Or is there a new ServiceStack.Api.Swagger Plugin package which uses OpenAPI 2.0?
Ok thanks, now I have removed the ServiceStack SwaggerApiFeature from my project …I’m now using the official swagger-ui from https://github.com/swagger-api/swagger-ui that implements Open API 2.0.