WSO2 API 经理屏蔽服务

WSO2 API Manager Mask a Service

是否可以在 API Manager 的服务中生成一个 mask,类似于:

API中的原始服务:

http://API/v1/profile
http://API/v1/account

带口罩:

http://API/v1/user-profile
http://API/v1/user-account

我的想法是:

  1. Publisher Page -> Runtime Configurations 添加一个 Message Mediation 删除了 user - 带有掩码的服务。

  2. API定义中,在发布者页面中,编辑JSONSwagger 在服务中放置一些掩码。这是 Swagger 中 TAG 的示例:

 tags: 
   - "/v1/kyc-perfil"

是否可能在 API 管理器的服务中生成掩码?

编辑: 看完蜜蜂的回答后,可以工作,但是在两个或多个服务中,每个服务中的请求与原始服务相同和不同。

我试过这样写:

    <property name="/v1/kyc-{DYNAMIC-PARAMETER}" expression="get-property('axis2', 'REST_URL_POSTFIX')"/>
    <property name="REST_URL_POSTFIX" value="/v1/{DYNAMIC-PARAMETER}" scope="axis2"/>

您可以执行选项 1。使用 REST_URL_POSTFIX 属性。试试这个。

阅读: <property name="post_fix" expression="get-property('axis2', 'REST_URL_POSTFIX')"/>

写: <property name="REST_URL_POSTFIX" value="new_post_fix" scope="axis2"/>

参考:https://docs.wso2.com/display/ESB470/HTTP+Transport+Properties#HTTPTransportProperties-Property:REST_URL_POSTFIXREST_URL_POSTFIX