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

Unexpected transformation of Map in LValue.asArray #158

Closed
msangel opened this issue Oct 27, 2019 · 0 comments
Closed

Unexpected transformation of Map in LValue.asArray #158

msangel opened this issue Oct 27, 2019 · 0 comments

Comments

@msangel
Copy link
Collaborator

msangel commented Oct 27, 2019

The fix must affect only the "for" tag behavior, but should not affect other cases.
Existent code cause this test case to be broken:

    @Test
    public void shouldProperlyUseMapAfterFirstOnArrayOfMaps() {
        // given
        String hash = "{ \"x\": [{\"rating\": 4.5 }, {\"rating\": 7.2 }] }";
        String template = "{{ x | first | map: 'rating' }}";

        // when
        String rendered = Template.parse(template).render(hash);

        // then
        assertEquals("4.5", rendered);
    }
}

The fix to this is on the way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants