Skip to content

Problem selecting inside arrays #263

Description

@dankristensen

I have created this unit test, that works when using same data on try.jsonata.org. But it currently fails using JSONata4Java

public void shouldEvaluateJsonataExpression() throws Exception {
    ObjectMapper objectMapper = DatabindCodec.mapper();
    JsonNode jsonNode = objectMapper.readTree("[[\"A\",\"B\",\"C\"],[\"AA\",\"BB\",\"CC\"]]");
    Expressions expressions = Expressions.parse("$.[$[0],$[1]]");
    JsonNode evaluatedNode = expressions.evaluate(jsonNode);
    assertThat(evaluatedNode.toString(), equalTo("[[\"A\",\"B\"],[\"AA\",\"BB\"]]"));
}

Any clues on what is wrong

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions