wso2 api manager map publisher URL parameters to values

随声附和 提交于 2019-12-24 09:17:55

问题


There is article from wso2 Map the Parameters of your Backend URLs with the API Publisher URLs.

Within it we have how the complete publisher URL looks like:

http://<hostname>:8280/<context>/<version>/<API resource>

And the whole use case is:

  1. You can define variables as part of the URI template of your API's resources. For example, in the URI template /business/{businessId}/address/, businessId is a variable.
  2. The variables in the resources are read during mediation runtime using property values with the "uri.var." prefix. For example, this HTTP endpoint gets the businessId that you specify in the resource http://localhost:8280/businesses/{uri.var.businessId}/details.

I would like to access during mediation also <version> and <context> part of the publisher URL. However, when I use expression uri.var.version I will get the empty string. Or if I use the parameter value in <context> then I will get also empty string value.

My sample:

<context>: /test/{service}
<version>: 1.0
<API resource>: /{operation}/{account}

http://localhost:8280/test/{service}/1.0/{operation}/{account}

I am able to map parameters from <API resource>, it works like expected. But when I try to get uri.var.service or uri.var.version I will allways get empty string value.

Is it possible to somehow get values of parameters from <context> and <version> during mediation?

来源:https://stackoverflow.com/questions/48832995/wso2-api-manager-map-publisher-url-parameters-to-values

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!