Skip to content

JSON.OBJKEYS/JSON.OBJLEN should return an empty array when being used with "multi path" #509

Closed

Description

@leibale
> JSON.SET foo $ {}
OK

> JSON.OBJKEYS foo $
1) (empty array)
> JSON.OBJKEYS bar $
(nil)
> JSON.OBJKEYS bar
(nil)

> JSON.OBJKEYS foo $
1) (empty array)
> JSON.OBJKEYS bar $
(nil)
> JSON.OBJKEYS bar
(nil)

Activity

  1. changed the title [-]JSON.OBJKEYS/JSON.OBJLEN empty keys and "multi path"[/-] [+]JSON.OBJKEYS/JSON.OBJLEN with empty keys and "multi path"[/+] on Nov 1, 2021
  2. changed the title [-]JSON.OBJKEYS/JSON.OBJLEN with empty keys and "multi path"[/-] [+]JSON.OBJKEYS/JSON.OBJLEN should return an empty array when begin used with "multi path"[/+] on Nov 1, 2021
  3. changed the title [-]JSON.OBJKEYS/JSON.OBJLEN should return an empty array when begin used with "multi path"[/-] [+]JSON.OBJKEYS/JSON.OBJLEN should return an empty array when being used with "multi path"[/+] on Nov 1, 2021
  4. oshadmi commented on Nov 23, 2021

    @oshadmi
    Collaborator

    @leibale Will be fixed by #548 by throwing an exception on missing key or path

  5. chayim commented on Nov 24, 2021

    @chayim
    Contributor

    I'd be in favour of our always returning an array - and sometimes that array having a length of one. At least it would be consistent from the user's perspective. Unpopular - yes. Thoughts?

  6. oshadmi commented on Nov 24, 2021

    @oshadmi
    Collaborator

    Updating according to #553

    • Throw an exception on non-existing key

    • Return empty array on non-existing path

  7. oshadmi commented on Nov 28, 2021

    @oshadmi
    Collaborator

    Fixed by #553

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions