ServiceStack Swagger - Mark method as 'New' or 'Updated' -


i'm going shot down in flames asking this:

i want mark endpoints in api 'new' or 'updated' when developers through swagger ui can see of recent additions.

does such thing exist?

that doesn't exist in core swagger-ui functionality or servicestack's swagger support.

but, can roll own without effort. trick summary , notes properties of routeattribute support raw html.

decorate dto this:

static class docs {     public const string newapi = @"<em class=""new-api"">new!</em> "; }  [route(...., notes = docs.newapi + "detailed description of dto goes here")] public class mydto {  ...  }  // or  [route(...., summary = docs.newapi + "summary goes here")] public class mydto {  ...  } 

then can add css swagger-ui index.html:

.new-api {     background-color: #ffff00;     font-weight: bold;     font-style: normal; } 

now can append string constant notes or summary property on appropriate route attributes, , appear styled marker on swagger ui. of course need manually add/remove these markers make changes dtos, it's pretty simple implement.


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -