Skip to content

JSON.GET: unable to correlate field name with value when using with multiple fields #1307

@luca-bassoricci

Description

@luca-bassoricci

Giving a json with this schema:

{
  "$id": "https://example.com/person.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Person",
  "type": "object",
  "properties": {
    "firstName": {
      "type": "string",
      "description": "The person's first name."
    },
    "lastName": {
      "type": "string",
      "description": "The person's last name."
    },
    "age": {
      "description": "Age in years which must be equal to or greater than zero.",
      "type": "integer",
      "minimum": 0
    }
  }
}

and this json data

{
  "firstName": "first",
  "age": 37
}

command JSON.GET key '$.["firstName","lastName","age"]' return ["first",37] but no indication about missing value; this is particular annoying because it's not possible to match returned values list with the associated fields.

Is there any way to solve (or workaround) the problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions