Generate JSON Schema for ASP.Net Web API

不羁岁月 提交于 2019-12-04 18:32:07

问题


I'm looking to generate JSON Schema for a WebAPI, including documentation from the XML comments. Its primarily so that I can then import that into our API docs (using apiary.io) I've managed to get a workaround solution by adding swagger (and swashbuckle) and then using the raw link on each service - but ideally I'd like something a bit cleaner, that works across all apis (this has to be done per service / controller), and didnt have so many dependencies.

Before I go and look at how swagger is doing this and seeing if it can be extracted, would be good to know if there are existing ways to do this?


回答1:


Yes, you can depend on Swagger and there is extension for it named swashbuckle which you can use it with Web API easily, check this post http://bitoftech.net/2014/08/25/asp-net-web-api-documentation-using-swagger/



来源:https://stackoverflow.com/questions/25668328/generate-json-schema-for-asp-net-web-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!