url rewriting - Complex routing WSO2 API resourse uri template -
short version. trying create api handle
/goals/risks /goals/types /goals/{goalid}
so far have isn't quite looking for. gives me /goals/goal/{goalid}
<api xmlns="http://ws.apache.org/ns/synapse" name="goalapi" context="/goals"> <resource methods="get" uri-template="/risks" faultsequence="returnerror">...</resource> <resource methods="get" uri-template="/types" faultsequence="returnerror">...</resource> <resource methods="get" uri-template="/goal/{goalid}" faultsequence="returnerror">...</resource> </api>
goalid match /^\d+$/
if can route somehow work. want add /goals/{goalid}/item , /goals/{goalid}/items/{itemid}
believe easy enough once figure out first step.
if there no way here, there way can rewrite url inside wso2 before reaches resource , able replace /goals/(\d+.*)
/goals/goal/$1?
know route though proxy , rewrite in apache or seems defeat wso2's purpose me.
so after looking more without success , getting no response on stared @ code can came with...
<api xmlns="http://ws.apache.org/ns/synapse" name="goalapi" context="/goals"> <resource methods="get" uri-template="/{goalid}" faultsequence="returnerror"> <insequence> <switch source="get-property('uri.var.goalid')"> <case regex="risks">...</case> <case regex="types">...</case> <default>...handle id here...</default> </switch> </insequence> ... </resource> </api>
Comments
Post a Comment