bohjak / schema-finder

A simple React component for finding your way through a JSONSchema
https://schema-finder.vercel.app
The Unlicense
0 stars 0 forks source link

Global Lazily-evaluated Cached AST-like Schema Object #6

Open bohjak opened 2 years ago

bohjak commented 2 years ago

Motivation

The current system of maintaining only references to the currently selected entry and its parents in the global state has reached its limits.

Under the current system it is not possible to

  1. add proper keyboard navigation,
  2. easily handle cases where child nodes depend on their parents and vice versa (e.g. if a child node has $ref we assume it has further children),
  3. change the visual representation to a non column based one (e.g. rendering the whole schema in a tree-like view).

Deps

This is likely to have a large effect on #1 and #2. The schema representation should then be general enough to not only support JSONSchema. Each schema type can then have its own parser.

Solution Proposal

TBD

bohjak commented 2 years ago

Alternate Proposal

Store children schemas directly in SchemaEntry (means dereferencing children when entry is being created) and make entry creation a global action.

This will mean only an adaptation of the existing system and should solve 1 and 2 (at least in most cases). I'm not super clear yet on the implications, but it might make 3 easier.