-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Bug Report
When using a nested Query object within the whereIn method, the generated API request incorrectly escapes the JSON of the nested query, leading to a failed API call.
To Reproduce
Initialize a Query object as a sub-query:
subQuery = stack.contentType("some-name").query().where("uid","blt407c1431a725f925")
Apply this subQuery using whereIn on a main query:
query.whereIn("my_propertyname", subQuery)
Expected behavior
The generated API request URL should correctly represent the nested query as a JSON object within the $in_query operator, like this:
Current behavior
The generated API request URL incorrectly escapes the nested query's JSON, treating it as a string:
This results in the following error from Contentstack:
Contentstack fetch entry request failed with status 141 and message: Failed to fetch entries. Please try again with valid parameters.
Additional context
The relevant code for the Query class can be found here: https://github.com/contentstack/contentstack-java/blob/master/src/main/java/com/contentstack/sdk/Query.java#L1433
A potentially related unit test that may not fully cover this scenario:
| void testUnitQueryWhereIn() { |