基本结构

<p><a href="https://swagger.io/docs/specification/about/?spm=a2c4g.11186623.2.35.72533829dWdKTl" target="_blank">Swagger</a>是一种基于OpenAPI规范的开源工具,用于设计和描述后端服务的API。目前平安云API网关支持导入Swagger2.0标准规范的文件以快速创建API。</p> <p><!--[if gte mso 9]><xml> <o:OLEObject Type="Embed" ProgID="PBrush" ShapeID="_x0000_i1025" DrawAspect="Content" ObjectID="_1633960387"> </o:OLEObject> </xml><![endif]-->&nbsp; &nbsp;&nbsp;<img src="https://pcp-portal-sca.obs-cn-shenzhen.pinganyun.com/pcp-portal-sca/20193010163413-1662fea59da6.png" style="height:26px; margin:0px; width:65px" />:</p> <p>&nbsp; &nbsp; &bull;&nbsp; Swagger中所有参数与取值均区分大小写。</p> <p>&nbsp; &nbsp; &bull;&nbsp; 可同时支持.yaml和.json格式文件。</p> <p><span style="font-size:18px"><strong>.yaml格式文件示例</strong></span></p> <table border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td style="background-color:#f7f8fa"> <p><span style="font-family:Consolas">swagger: &#39;2.0&#39;</span></p> <p><span style="font-family:Consolas">info: {description: The description of group, title: groupName}</span></p> <p><span style="font-family:Consolas">paths:</span></p> <p><span style="font-family:Consolas">&nbsp; &#39;/path&#39;:</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp; method:</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...</span></p> </td> </tr> </tbody> </table> <p><span style="font-size:18px"><strong>.json格式文件示例</strong></span></p> <table border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td style="background-color:#f7f8fa"> <p><span style="font-family:Consolas">{</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp; &quot;swagger&quot;:&quot;2.0&quot;,</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp; &quot;info&quot;:{</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;description&quot;:&quot;The description of group&quot;,</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;title&quot;:&quot;groupName&quot;</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp; },</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp; &quot;paths&quot;:{</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;/path&quot;:{</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;method&quot;:{</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp; }</span></p> <p><span style="font-family:Consolas">}</span></p> </td> </tr> </tbody> </table>
以上内容是否解决了您的问题?
请补全提交信息!
咨询·建议

电话咨询

400-151-8800

邮件咨询

cloud@pingan.com

在线客服

工单支持

解决云产品相关技术问题