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

Impossible to reference attributes starting with numbers and having a dash separator #91

Closed
achempion opened this issue Aug 20, 2021 · 5 comments
Labels
enhancement New feature or request syntax template language syntax

Comments

@achempion
Copy link
Contributor

I've tried

{%= data.73 %} // outputs nothing
{%= data.7-3 %} // raises java.lang.NullPointerException

the payload

{
  "data": {
    "7-3": "2021-08-20"
  }
}
@achempion
Copy link
Contributor Author

achempion commented Aug 20, 2021

closest use case for this pattern would be UUIDs

@erdos
Copy link
Owner

erdos commented Aug 20, 2021

Hi, thanks for opening the issue, it sounds like a real blocker. What do you think about the following approach?

We could introduce a new access operator so fields could be references by string literals, something like this:

{%= data['7-3'] %}

@erdos
Copy link
Owner

erdos commented Aug 20, 2021

See PR #93 for implementation in progress.

@erdos
Copy link
Owner

erdos commented Aug 20, 2021

@achempion Released version 0.3.24 with the new feature.

@erdos erdos added enhancement New feature or request syntax template language syntax labels Aug 20, 2021
@achempion
Copy link
Contributor Author

Great, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request syntax template language syntax
Projects
None yet
Development

No branches or pull requests

2 participants