生成JSON模式的ASP.Net的Web API [英] Generate JSON Schema for ASP.Net Web API

查看:228
本文介绍了生成JSON模式的ASP.Net的Web API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我期待产生JSON模式的的WebAPI,包括XML注释文档。
它的主要目的是让我然后导入到我们的API文档(使用apiary.io)
我已经成功地获得通过添加招摇一种变通方法解决方案(和swashbuckle),然后使用各项服务的原始环节 - 但理想的我想的东西有点清洁,跨所有API的工作原理(这有每个服务做/控制器),并​​没有那么多的依赖关系。

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?

推荐答案

是的,你可以依靠扬鞭并且有扩展它命名swashbuckle您可以使用Web API的使用很容易,看看这个帖子的 http://bitoftech.net/2014/08/25/asp -net-Web的API的文档,使用-招摇/

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/

这篇关于生成JSON模式的ASP.Net的Web API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆