Skip to content

Figure out how to handle data in keys instead of values #158

@thomasborgen

Description

@thomasborgen

Some formats have interesting data in key names instead of in values.

For example JSONSchema.

{
  "$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
    }
  }
}

Every child object in "properties" is a fields name. That means that it is interesting data.

We could argue that if its just a key that we would need to know the path to anyways, we don't need to be able to map it. Which is fair. But the properties object could have any amount of children and it definitely feels more like an array than an object.

So what do we do?

Maybe we can support iterating over an objects children?

We also need to consider the reverse. What if we wanted to create this JSONSchema data. How should we go about mapping input data into a key name?

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions