Skip to content

JSONMatcherBuilder matcher doesn't handle lists nested inside a sub-tuple #4

@sbarber2

Description

@sbarber2

From Mic Hussey:

do you know if anyone has implemented handling of matching with nested arrays of tuples?

I discovered that when I wanted to match something like this:

    JSONMatcherBuilder mb = new JSONMatcherBuilder(dequeuerFeatureDataOut.getSchema()).ignoreMissingFields(true);

    String outputTupleAsJSONString = "{\"Entity\":{\"EntityId\":\"ent1\"}, \"DeviceReadings\":["
            +"{\"Device\":{\"PointId\":\"pt1000\",\"ParentEntityId\":\"ent1\"}, \"Readings\":[{\"Value\":10.0}]},"
            +"{\"Device\":{\"PointId\":\"pt1001\",\"ParentEntityId\":\"ent1\"}, \"Readings\":[{\"Value\":20.0}]},"
            +"{\"Device\":{\"PointId\":\"pt1002\",\"ParentEntityId\":\"ent1\"}, \"Readings\":[{\"Value\":30.0}]}"
        +"]}";`

that the matcher stopped recursing once it hit an array.

Metadata

Metadata

Assignees

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