Mule 4: uriParams size is showing as 0 even though it is there

266 Views Asked by At

So I created a endpoint inside the raml file such as:

    /proxy:
  /{proxyDestinationTarget}:
    uriParameters:
      proxyDestinationTarget: 
        type: string
        example: "myurl.com"
    post:
      description: Pass through operation that targets IAA 
      is: [client-credentials-required,standard-error-responses,traceHeaders]

and then inside of the logic.xml in my variable component I have

attributes.uriParams.'proxyDestinationTarget'

when I send the request in postman and debug i am getting a uriParams size of 0 the url i entered in postman is

https://localhost:8092/proxy/uat.something.somethingElse.com/Assign/Assignment.svc

but if i send a request like this :

https://localhost:8092/proxy/uat.something.somethingElse.com

I get a uriParam size = 1 which is what I want. I guess the / is whats causing the problem. how can I pass url as uri param with escape characters???

1

There are 1 best solutions below

0
On

It looks like you are not sending an URL that matches the RAML definition in the first case.

For the URL:

https://localhost:8092/proxy/uat.something.somethingElse.com/Assign/Assignment.svc

The RAML defined that the API should expect /proxy/{proxyDestinationTarget} but it is receiving something like /proxy/{proxyDestinationTarget}/Assign/Assignment.svc, where {proxyDestinationTarget} is uat.something.somethingElse.com, but nothing matches /Assign/Assignment.svc. The API should include those two last components too to match. It is not escaping them, they probably need to be defined.