Open hernanDatgDev opened 1 week ago
Thanks for reporting. I've done some test and I am not able to reproduce. Would you mind providing a complete failing reproducer? From the exception and the result of your initial investigation it seems more a Camel core bug. You may try the very same route with a local development (ie, via camel run
from Camel JBang): in this way we can understand better what part of the system would be requiring a fix.
What happened?
There's an issue providing an open-api spec (contract first) when the spec has variables in the paths i.e.
my-api.json:
The api spec is provided via configmap and endpoints without variables can be reached as expected. There is an index out of bounds error when trying to reach endpoint
/users/{employeeid}
with/users/myid123
:What I noticed is that endpoing
/users/{employeeid}/location
can be reached with/users/myid123/location
but the expectation is that there is a header:employeeid = myid123
however the value of the header is actuallylocation
. It seems there is an offset when the endpoint is being parsed for variables. The json I return shows the wrong value parsed for employeeId:In the HttpHelper.evalPlaceholders() that's throwing the exception, I imagine there might be some misconfiguration on what is considered the "URL path" vs the "consumerPath". I haven't been able to identify exactly where the issue is but I imagine it will be in:
📓 NOTE: When using the rest DSL e.g.
rest().get("/users/{employeeid}")
, the api works as expected with no issues.Steps to reproduce
/users/{id}
Camel K version
v2.5.0