Skip to content

Jsonpath $..*.title does not work anymore since 2.7.0 #1052

@hwiegard

Description

@hwiegard

For the books json example, the jsonpath $..*.title does not work anymore since version 2.7.0 but it worked fine up to version 2.6.0. It used to return the array ["Sayings of the Century","Sword of Honour","Moby Dick","The Lord of the Rings"] which is also returned by jsonpath testers like https://jsonpath.com/. But now only an empty array [] is returned.

The expression gets executed using this Java code:

        final JsonMapper objectMapper = JsonMapper.builder()
                                           .configure( SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS, true )
                                           .enable( JsonReadFeature.ALLOW_TRAILING_COMMA.mappedFeature() )
                                           .enable( JsonReadFeature.ALLOW_SINGLE_QUOTES.mappedFeature() )
                                           .build();
        final Configuration conf = Configuration
                .builder()
                .jsonProvider( new JacksonJsonProvider( objectMapper ) )
                .mappingProvider( new JacksonMappingProvider( objectMapper ) )
                .build();

        return JsonPath.using( conf ).parse( json ).read( jsonPath, new TypeRef<>()
        {
        } );

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