后端服务类型为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"> info: {description: demo group!, title: demo}</span></p>
<p><span style="font-family:Consolas"> </span></p>
<p><span style="font-family:Consolas"> paths:</span></p>
<p><span style="font-family:Consolas"> </span></p>
<p><span style="font-family:Consolas"> /request/any/{reqPath}:</span></p>
<p><span style="font-family:Consolas"> </span></p>
<p><span style="font-family:Consolas"> x-any-method:</span></p>
<p><span style="font-family:Consolas"> </span></p>
<p><span style="font-family:Consolas"> operationId: mockDemo</span></p>
<p><span style="font-family:Consolas"> </span></p>
<p><span style="font-family:Consolas"> parameters:</span></p>
<p><span style="font-family:Consolas"> </span></p>
<p><span style="font-family:Consolas"> - {description: request param in path, in: path, name: reqPath, required: true,</span></p>
<p><span style="font-family:Consolas"> </span></p>
<p><span style="font-family:Consolas"> type: string, x-example: apigateway}</span></p>
<p><span style="font-family:Consolas"> </span></p>
<p><span style="font-family:Consolas"> - {description: request param in query, in: query, name: reqQuery, required: true,</span></p>
<p><span style="font-family:Consolas"> </span></p>
<p><span style="font-family:Consolas"> type: integer, x-example: '111'}</span></p>
<p><span style="font-family:Consolas"> </span></p>
<p><span style="font-family:Consolas"> - {description: request param in header, in: header, name: reqHeader, default: '3.14',</span></p>
<p><span style="font-family:Consolas"> </span></p>
<p><span style="font-family:Consolas"> required: false, type: number, x-example: '3.14'}</span></p>
<p><span style="font-family:Consolas"> </span></p>
<p><span style="font-family:Consolas"> responses:</span></p>
<p><span style="font-family:Consolas"> </span></p>
<p><span style="font-family:Consolas"> '200': {description: success, x-description: success description}</span></p>
<p><span style="font-family:Consolas"> </span></p>
<p><span style="font-family:Consolas"> '400': {description: failure, x-description: failure description}</span></p>
<p><span style="font-family:Consolas"> </span></p>
<p><span style="font-family:Consolas"> summary: The description of the API!</span></p>
<p><span style="font-family:Consolas"> </span></p>
<p><span style="font-family:Consolas"> x-auth-type: NO_AUTH</span></p>
<p><span style="font-family:Consolas"> </span></p>
<p><span style="font-family:Consolas"> x-backend:</span></p>
<p><span style="font-family:Consolas"> </span></p>
<p><span style="font-family:Consolas"> mockHeaders:</span></p>
<p><span style="font-family:Consolas"> </span></p>
<p><span style="font-family:Consolas"> - {name: PA001, value: 平安集团}</span></p>
<p><span style="font-family:Consolas"> </span></p>
<p><span style="font-family:Consolas"> - {name: PA011, value: 平安科技}</span></p>
<p><span style="font-family:Consolas"> </span></p>
<p><span style="font-family:Consolas"> mockResult: mock result</span></p>
<p><span style="font-family:Consolas"> </span></p>
<p><span style="font-family:Consolas"> type: MOCK</span></p>
<p><span style="font-family:Consolas"> </span></p>
<p><span style="font-family:Consolas"> x-path-match-type: PREFIX</span></p>
<p><span style="font-family:Consolas"> </span></p>
<p><span style="font-family:Consolas"> x-request-cors: false</span></p>
<p><span style="font-family:Consolas"> </span></p>
<p><span style="font-family:Consolas"> x-request-type: PRIVATE</span></p>
<p><span style="font-family:Consolas"> </span></p>
<p><span style="font-family:Consolas"> x-response-content-type: passthrough</span></p>
<p><span style="font-family:Consolas"> </span></p>
<p><span style="font-family:Consolas"> x-response-failure-result: failure</span></p>
<p><span style="font-family:Consolas"> </span></p>
<p><span style="font-family:Consolas"> x-response-success-result: success</span></p>
<p><span style="font-family:Consolas"> </span></p>
<p><span style="font-family:Consolas"> swagger: '2.0'</span></p>
</td>
</tr>
</tbody>
</table>
提交成功!非常感谢您的反馈,我们会继续努力做到更好!