API Swagger 客户端控制台不接受 MANAGER 1.9 查询参数

API MANAGER 1.9 query parameters are not accepted in swagger client console

部署原型后,当尝试在没有查询参数的情况下调用服务时它可以工作,但是当我给查询参数一个值时它会说找不到资源

<am:fault xmlns:am="http://wso2.org/apimanager">
<am:code>403</am:code>
<am:type>Status report</am:type>
<am:message>Runtime Error</am:message>
<am:description>No matching resource found in the API for the given     request</am:description>
</am:fault>

我们如何支持在 URL

之后接受任何查询参数
  <resource methods="GET"
         uri-template="accounts/{account_id}/asd"
         faultSequence="fault">

您是否启用了 JWT 缓存?如果您已启用,API Manager 1.9.0 中有一个已知的 issue,它将在即将发布的版本中修复。

谢谢!

当您在 API 管理器中提供 URI 模式时,如果您的 URL 包含查询参数,则必须在末尾提供“?*”字符。即使 swagger 能够使用该参数创建 URL,运行时也无法将其识别为查询参数(运行时基于 Apache Synapse)。通过添加该字符,您将强制 Synapse 将查询参数附加到 URL。 所以你的模板应该是。

<resource methods="GET" uri-template="accounts/{account_id}/asd?*" faultSequence="fault">

谢谢