Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REST connector sends different data format than it should #239

Closed
markfarkas-camunda opened this issue Jan 24, 2023 · 3 comments
Closed
Assignees
Labels
blocked Task is blocked by an other task or release. kind:bug Something isn't working scope:rest

Comments

@markfarkas-camunda
Copy link
Contributor

Describe the Bug

When I try to use the REST connector to call the /v1/variables/search Operate API it does not work with the same body which works in Swagger UI.

Steps to Reproduce

  1. Start a process instance with Variables
{
"customerId":"ABC"
}
  1. In this same process add a REST connector with the proper authentication and make an HTTP request to Operate (http://localhost:8081/v1/variables/search) with the body : {"filter": {"name":"customer","value":"{\"name\":\"aa\",\"id\":\"ABC\"}"}}
  2. Call the /v1/variables/search in swagger (http://localhost:8081/swagger-ui/index.html#/Variable/search) with the JSON object provided in the REST connector's body.

Expected Behavior

Point 2 and point 3 should give the exact same result.
In reality: swagger call returns the items, but in the REST connector's response the items property is empty.

Environment

  • OS: Windows 11
  • Library version: latest
  • Camunda version: latest

See also

https://camunda.slack.com/archives/C02UMKN3DTL/p1674054860769479

Relates to

camunda/camunda#9859

@markfarkas-camunda markfarkas-camunda added the kind:bug Something isn't working label Jan 24, 2023
@markfarkas-camunda markfarkas-camunda self-assigned this Jan 24, 2023
@markfarkas-camunda markfarkas-camunda changed the title REST connector sends different data format then it should be REST connector sends different data format than it should Feb 1, 2023
@markfarkas-camunda
Copy link
Contributor Author

I was able to verify that the REST connector sends different body than the original input for body.
The reason behind this is escaping the escape character.

The original user defined body:

{
  "filter": {
    "name":"customer",
    "value":"{\"name\":\"aa\",\"id\":\"ABC\"}"
  }
}

The actual body used in the request:

{
  "filter": {
    "value": "{\\\"name\\\":\\\"aa\\\",\\\"id\\\":\\\"ABC\\\"}",
    "name": "customer"
  }
}

The OutboundConnectorContext object already contains these extra escape characters, so the issue comes from a deeper level.

The Zeebe team already created a bug ticket for this. Solving that ticket will automatically solve this issue as well.

At this point there is no further action required from connectors team.

I will leave the ticket in the backlog as a reference.

@markfarkas-camunda markfarkas-camunda added the blocked Task is blocked by an other task or release. label Feb 21, 2023
chillleader pushed a commit that referenced this issue Jul 25, 2023
chore(deps): update eclipse-temurin docker tag to v17.0.5_8-jre
@AlexeiBaranov
Copy link

AlexeiBaranov commented Nov 2, 2023

It seems to be a problem with Feel. The Feel engine must unescape string literals in the expression before using it, but it doesn't:
image

From other side, it works fine when we escape the value of the context variable:
image

ps:
image

@abbasadel
Copy link

Hey connectors team, this bug is currently resolved in Zeebe 8.3.4 release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Task is blocked by an other task or release. kind:bug Something isn't working scope:rest
Projects
None yet
Development

No branches or pull requests

3 participants