Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Documenting ServiceStack web services [closed]

What are the options for documenting a ServiceStack bases web services and I'm not talking about a one line string.

I would like to be able to document, in detail (which can be long), return types, possible HTTP responses, add detailed examples etc.

Is there any support for this in ServiceStack (I couldn't find it)? If not has anybody solved the problem in some other way.

like image 647
tymtam Avatar asked Aug 24 '11 08:08

tymtam


2 Answers

You can provide metadata descriptions for each of your web services by attributing your Request DTOs with [Api] and [ApiMember] attributes. This information will be displayed on the dynamic metadata pages.

Another option is to simply create your own dynamic html page, which ServiceStack allows you to do by simply returning a string (containing your html markup). If you go this route you can access the Service Types metadata with the global EndpointHost.ServiceOperations property.

Also if dynamically generating html with C# is not your preference you can also generate html using the built-in Razor Markdown format which makes generating html quite pleasant :)

like image 113
mythz Avatar answered Sep 24 '22 02:09

mythz


I realize this question is a couple years old, but there is now Swagger support for ServiceStack API's @ https://github.com/ServiceStack/ServiceStack/wiki/Swagger-API

like image 1
JesseP Avatar answered Sep 23 '22 02:09

JesseP