JSON-RPC Swagger组合 [英] JSON-RPC Swagger combination

查看:460
本文介绍了JSON-RPC Swagger组合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在考虑使用此库为我的Web服务实现JSON-RPC.我还想为我的服务实现 Swagger .

I am considering to implement JSON-RPC for my web service with this library. I would also like to implement Swagger for my service.

但是,我不确定这两者是否可以很好地结合在一起.在JSON-RPC中,所有方法都位于同一个资源的后面,而在Swagger中则没有任何意义.

However, I am not sure, if these two are a good combination together. In JSON-RPC all methods are behind the same resource, while that does not make any sense in Swagger.

我想知道以下情况:

  1. 是否有可能将这些技术完全结合在一起?
  2. JSON-RPC仍然是一种好技术吗?还是手动实施更好?

您的想法受到赞赏.

相关的,未提出疑问的问题: Swagger和json-rpc

Related, unaswered question: Swagger and json-rpc

推荐答案

来自Swagger团队,对JSON-RPC知识很少,我可以提供部分答案.

Coming from the Swagger team, and having little knowledge of JSON-RPC I can provide a partial answer.

根据您在问题中描述的内容,绝对不可能使用Swagger来记录此类API. Swagger只能记录将唯一操作定义为路径和HTTP动词的组合的唯一操作.

Based on what you described in the question, it would definitely not be possible to use Swagger to document such an API. Swagger can only document unique operations where a unique operation is defined as a combination of path and a HTTP verb.

不幸的是,我不能评论JSON-RPC的功能,这不是因为偏见,而是因为我对它的机制不够了解.此外,在描述类似REST的API时,Swagger的目标不是要涵盖100%的用例,这并不意味着任何超出其范围的东西都是不好的.

Unfortunately, I cannot comment about the power of JSON-RPC, not because of bias but because I'm not aware enough of its mechanics. To add to that, Swagger does not aim to cover 100% of use cases when describing REST-like APIs, and that does not mean that anything out of its scope is not good.

这篇关于JSON-RPC Swagger组合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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