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

Please help me decide about extending syntax for jmespath #70

Open
Thaina opened this issue Sep 3, 2019 · 1 comment
Open

Please help me decide about extending syntax for jmespath #70

Thaina opened this issue Sep 3, 2019 · 1 comment

Comments

@Thaina
Copy link

Thaina commented Sep 3, 2019

I am in process of starting new project extending jmespath with more syntax. Currently now I work on basic jmespath and extend it to support math operation + - * / % with antlr. I got the antlr file from https://github.com/burtcorp/jmespath-java

I am now stuck on design decision and wish that you could kindly help me with some suggestion

  • Should I support bitwise operation with && || ^ ?

    • Is it acceptable to use && and || as bitwise operator?
      • 1 || 2 will return 3 for instance
    • And still wonder is it really necessary, especially xor operator ^
      • But if I include this ^ operator, it also support boolean xor in addition to && and ||
  • Should I bring back root node $ from jsonpath?

  • Should I bring back ** operator from jsonpath?

  • Should I support ternary condition ? true : false operator ?

  • Should I support ?? and ?! operator ?

    • And remove support on && || for null check in the same manner of js
      • It might be used as bitwise operator above instead
    • One difference is it will not treat false as null. Only null and empty
  • I would like to add support to backtracing to parent node with @.. syntax

    • nth number of dots - 1 will backtrack to nth parent
      • $.me.obj.. is equal to $.me
      • $.me.obj... is equal to $
    • Is there any better syntax for this ?
  • I would like to add support to index value with # symbol

    • For array, # would be index number 0,1,2,...
    • For object, # would be string "{key}"
    • What should I do for deep reference ?
      • # for current level, ## for previous level ?
        • $.me.obj[0].# return 0
        • $.me.obj[0].## return "obj"
        • $.me.obj[0].### return "me"
      • # for current level, ..# for previous level ?
        • $.me.obj[0].# return 0
        • $.me.obj[0]..# return "obj"
        • $.me.obj[0]...# return "me"
      • # for current level, ## will be fullpath as array?
        • $.me.obj[0].# return 0
        • $.me.obj[0].## return ["me","obj",0]
    • What should I do for slice and query? # will be index of sliced iteration or actual index?
  • I would like to support object projection key by expression Should multiselect hash accept expressions as keys #64

  • Any other idea overall? Any other things you don't satisfied with jmespath?

@FelixReuthlingerBMW
Copy link

Even just having the basic math would be fantastic!

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