Swagger: 如何使用生成的JSON文件?

huangapple go评论66阅读模式
英文:

Swagger: how to use the generated json files?

问题

我有通过Swashbuckle生成的JSON文件,用于我应该使用的REST API,我想知道是否有工具可以将这些文件作为输入并允许更容易地浏览公开方法、请求负载、响应负载、标头等。此外,在.NET中工作时,是否有一种方法或工具可以生成与WSDL文档一样的负载类?

英文:

I've been provided with the json files generated by swashbuckle for a rest api I should be consuming and I was wondering if there are tools that can take those files as input and allow an easier navigation of exposes methods, request payloads, response payloads, headers, etc. Also when working in .NET is there a way or tool to generate payload classes as with wsdl documents?

答案1

得分: 4

你可以使用Swagger编辑器:

https://editor.swagger.io/

这将允许您查看和浏览方法。只需粘贴您收到的JSON内容。

然后,页面顶部还有不同语言的“生成客户端”选项。这将为您生成C#(或其他)语言文件。

英文:

You can use the swagger editor

https://editor.swagger.io/

This will allow you to view and browse the methods. Simply paste the contents of your received JSON.

Then also, at the top of the page you have "generate client" options for different languages. Which will generate C# (or other) langauge files for you.

huangapple
  • 本文由 发表于 2023年6月1日 20:43:58
  • 转载请务必保留本文链接:https://go.coder-hub.com/76382000.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定