尝试此 API 在 wso2 EI 6.4 中不起作用



我使用 swagger yaml 文件生成了 API。API 已成功生成,我也能够在通过单击"Swagger"链接进行检查时看到 json。但是当我尝试通过单击"尝试此 API"来测试此 API 时,此链接似乎不起作用。

http://localhost:8280/CustomAPI:v1.0.0?swaggertryit

是否有任何配置,我丢失了?任何指示/帮助都非常感谢。

谢谢 维平

根据发行说明,EI 6.6.0 中引入了 Swagger 功能。 https://docs.wso2.com/display/EI660/About+this+Release

在 wso2 EI 6.4 中默认不启用 Swagger tryit 和 swagger json 功能。它在 wso2 EI 6.6 中得到了增强。要在 6.4 中完成此功能,请在 conf/carbon.xml 标签 HttpGetRequestProcessor 内的文件中添加以下属性并重新启动 wso2。

<Processor>
<Item>swagger.json</Item>           
<Class>org.wso2.carbon.mediation.transport.handlers.requestprocessors.swagger.format.SwaggerJsonProcessor</Class>
</Processor>
<Processor>
<Item>swagger.yaml</Item>           
<Class>org.wso2.carbon.mediation.transport.handlers.requestprocessors.swagger.format.SwaggerYamlProcessor</Class>
</Processor>
<Processor>
<Item>swaggertryit</Item>
<Class>org.wso2.carbon.tryit.SwaggerTryitRequestProcessor</Class>
</Processor>

最新更新