后端服务类型为MOCK的示例

<p>后端服务类型为MOCK的示例如下:</p> <table border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td style="background-color:#f7f8fa; vertical-align:top"> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp; info: {description: demo group!, title: demo}</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp; paths:</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /request/any/{reqPath}:</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x-any-method:</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; operationId: mockDemo</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; parameters:</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - {description: request param in path, in: path, name: reqPath, required: true,</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; type: string, x-example: apigateway}</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - {description: request param in query, in: query, name: reqQuery, required: true,</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; type: integer, x-example: &#39;111&#39;}</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - {description: request param in header, in: header, name: reqHeader, default: &#39;3.14&#39;,</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; required: false, type: number, x-example: &#39;3.14&#39;}</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; responses:</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#39;200&#39;: {description: success, x-description: success description}</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#39;400&#39;: {description: failure, x-description: failure description}</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; summary: The description of the API!</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x-auth-type: NO_AUTH</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x-backend:</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mockHeaders:</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - {name: PA001, value: 平安集团}</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - {name: PA011, value: 平安科技}</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mockResult: mock result</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; type: MOCK</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x-path-match-type: PREFIX</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x-request-cors: false</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x-request-type: PRIVATE</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x-response-content-type: passthrough</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x-response-failure-result: failure</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x-response-success-result: success</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp;</span></p> <p><span style="font-family:Consolas">&nbsp;&nbsp;&nbsp; swagger: &#39;2.0&#39;</span></p> </td> </tr> </tbody> </table>
以上内容是否解决了您的问题?
请补全提交信息!
咨询·建议

电话咨询 - 7x24 小时

400-151-8800

邮件咨询

cloud@pingan.com

在线客服

7x24 小时,急速解答

工单支持

解决云产品相关技术问题