开发者

Documenting ServiceStack web services [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.

Want to improve this question? Update the question so it focuses on one problem only by editing this post.

Closed 5 years ago.

开发者_开发问答 Improve this question

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.


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 :)


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜