Skip to content

Switch JSON schema generator library to ts-json-schema-generator #173

Description

@adgad

Problem

(raised by @lastHokage )

With Beta Components, we are generating the Spark UI from the generated JSON schema for a content-tree component. To make the UI logical, we want the order of the input components to match the order defined in the TS definition. However, our current JSON schema generator sorts the properties in some different order.

Proposal

Switch out typescript-json-schema for ts-json-schema-generator

  • It works with the same mechanism (CLI)
  • It supports an --unstable flag, which does not sort the properties and (at first glance) keeps them in the same order as the TS file
  • The library we currently use suggests it! This library is lightweight and more or less in maintenance mode. For a more complete JSON schema generator, take a look at [ts-json-schema-generator](https://github.com/vega/ts-json-schema-generator).

We would have to verify the output of the schemas is otherwise the same, or we can get an equivalent output with some combination of flags.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions