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

Maintain order when using inline maps and lists #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Maintain order when using inline maps and lists #29

wants to merge 1 commit into from

Conversation

newoga
Copy link

@newoga newoga commented Jul 3, 2014

First of all, awesome tool. I just recently starting messing around with MVEL.

I sent an email to the user mailing list this morning regarding the possibility of switching the parser's Map implementation from HashMap to LinkedHashMap so that the order of keys are maintained based on insertion.

My primary use case this functionality was so that I could have a nice syntax to build maps for a JSON serializer. For REST APIs, I prefer when the JSON keys are ordered in a predictable way and are consistent with API documentation.

This pull request has what I think are the necessary changes, and it includes a test that confirms the order works (test would break if HashMap implementation was kept).

…ntain order of keys when expressing maps and lists inline.
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

Successfully merging this pull request may close these issues.

1 participant