后端服务类型为HTTP的示例
<p>后端服务类型为HTTP的示例如下:</p>
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td style="background-color:#f7f8fa">
<p><span style="font-family:Consolas">info: {description: demo group!, title: demo}</span></p>
<p><span style="font-family:Consolas">paths:</span></p>
<p><span style="font-family:Consolas"> /request/postDemo/{reqPath}:</span></p>
<p><span style="font-family:Consolas"> post:</span></p>
<p><span style="font-family:Consolas"> operationId: caseHttp</span></p>
<p><span style="font-family:Consolas"> parameters:</span></p>
<p><span style="font-family:Consolas"> - description: request param in path</span></p>
<p><span style="font-family:Consolas"> in: path</span></p>
<p><span style="font-family:Consolas"> name: reqPath</span></p>
<p><span style="font-family:Consolas"> required: true</span></p>
<p><span style="font-family:Consolas"> type: string</span></p>
<p><span style="font-family:Consolas"> x-backend-parameters:</span></p>
<p><span style="font-family:Consolas"> - {location: path, name: backPath}</span></p>
<p><span style="font-family:Consolas"> x-example: PA011</span></p>
<p><span style="font-family:Consolas"> - description: request param in query</span></p>
<p><span style="font-family:Consolas"> in: query</span></p>
<p><span style="font-family:Consolas"> name: reqQuery</span></p>
<p><span style="font-family:Consolas"> required: false</span></p>
<p><span style="font-family:Consolas"> default: '111'</span></p>
<p><span style="font-family:Consolas"> type: integer</span></p>
<p><span style="font-family:Consolas"> x-backend-parameters:</span></p>
<p><span style="font-family:Consolas"> - {location: query, name: backQuery}</span></p>
<p><span style="font-family:Consolas"> x-example: '111'</span></p>
<p><span style="font-family:Consolas"> - description: request param in header</span></p>
<p><span style="font-family:Consolas"> in: header</span></p>
<p><span style="font-family:Consolas"> name: reqHeader</span></p>
<p><span style="font-family:Consolas"> required: true</span></p>
<p><span style="font-family:Consolas"> type: number</span></p>
<p><span style="font-family:Consolas"> x-backend-parameters:</span></p>
<p><span style="font-family:Consolas"> - {location: header, name: backHeader}</span></p>
<p><span style="font-family:Consolas"> x-example: 'apigateway'</span></p>
<p><span style="font-family:Consolas"> responses:</span></p>
<p><span style="font-family:Consolas"> '200': {description: success, x-description: success description}</span></p>
<p><span style="font-family:Consolas"> '400': {description: failure, x-description: failure description}</span></p>
<p><span style="font-family:Consolas"> summary: The description of the API!</span></p>
<p><span style="font-family:Consolas"> x-auth-type: AK_SK_AUTH</span></p>
<p><span style="font-family:Consolas"> x-backend: {address: 'http://10.10.10.10:8888', method: ANY, path: '/back/anyDemo/{backPath}/{consPath}/{sysPath}',timeout: 6000, type: HTTP}</span></p>
<p><span style="font-family:Consolas"> x-body-desc: The description of request body</span></p>
<p><span style="font-family:Consolas"> x-constant-parameters:</span></p>
<p><span style="font-family:Consolas"> - {description: constant param in path, location: path, name: consPath, value: 'PA011'}</span></p>
<p><span style="font-family:Consolas"> - {description: constant param in query, location: query, name: consQuery, value: 'apigateway'}</span></p>
<p><span style="font-family:Consolas"> - {description: constant param in header, location: header, name: consHeader, value: 'GroupName'}</span></p>
<p><span style="font-family:Consolas"> x-path-match-type: NORMAL</span></p>
<p><span style="font-family:Consolas"> x-request-cors: true</span></p>
<p><span style="font-family:Consolas"> x-request-type: PUBLIC</span></p>
<p><span style="font-family:Consolas"> x-response-content-type: application/xml;charset=utf-8</span></p>
<p><span style="font-family:Consolas"> x-response-failure-result: failure</span></p>
<p><span style="font-family:Consolas"> x-response-success-result: success</span></p>
<p><span style="font-family:Consolas"> x-signature-algorithm: H_MAC_SHA256</span></p>
<p><span style="font-family:Consolas"> x-system-parameters:</span></p>
<p><span style="font-family:Consolas"> - {location: path, name: sysPath, value: PA-AG-RequestId}</span></p>
<p><span style="font-family:Consolas"> - {location: query, name: sysQuery, value: PA-AG-Timestamp}</span></p>
<p><span style="font-family:Consolas"> - {location: header, name: sysHeader, value: PA-AG-APIName}</span></p>
<p><span style="font-family:Consolas">swagger: '2.0'</span></p>
</td>
</tr>
</tbody>
</table>
提交成功!非常感谢您的反馈,我们会继续努力做到更好!