Skip to content

New JSON generator schema #214

Description

@flakey5

Enter your suggestions in details:

Background

This issue is regarding the new format for the JSON generator.
It only pertains to the format of the JSON files, the implementation details will be discussed once a censensus is reached here.

Why a new format?

There are a handful of issues with the current format, with some of the main ones being:

  • Maintainability
    • Without a pre-defined schema, it can be harder to tell where a property should be expected to go within the output
    • There isn't a great way to communicate changes to this schema when they happen
  • Consumability
    • Users don't know what to expect without going through the generator's code or looking through all of the outputted JSON files
    • The current format represents some fields in unfortunate ways (i.e. Markdown being parsed in HTML for descriptions)

Relevant: DefinitelyTyped/DefinitelyTyped#70298, #57

The new format

The newly proposed schema for json generator is available here.
An example of it being used for Buffer is available here.

The new proposed schema for the json-all generator is available here.
An example of it being used is available here.

Key Points

JSON Schema

The new formats have JSON schemas defined. This gives us three main advantages over the current format:

  1. Consumers know what to expect
  2. We can version the output files in a standardized way (via the $id property)
  3. The schemas can be used to generate the types used within the JSON generator. This will help with maintaining the generator in the long run since we don't have to worry about them getting out of sync.

JSDoc Property Names

JSDoc keys (i.e. @name, @type) are used in the format.
This is mainly to make the files easier to consume.

TODOs

Here's what's left to be done with the new format:

Activity

  1. self-assigned this
    on Mar 20, 2025
  2. added theissue type on Mar 20, 2025
  3. flakey5 commented on Mar 20, 2025

    @flakey5
    MemberAuthor

    cc @nodejs/web-infra

  4. ovflowd commented on Mar 22, 2025

    @ovflowd
    Member

    The newly proposed schema for json generator is available here.
    An example of it being used for Buffer is available here.

    This looks really good!

  5. ovflowd commented on Mar 22, 2025

    @ovflowd
    Member

    cc @nodejs/web-infra

    I finished giving a look! 👍

  6. flakey5 commented on Mar 22, 2025

    @flakey5
    MemberAuthor

    cc @nodejs/documentation

  7. added a commit that references this issue on May 31, 2025
    a4cd425
  8. added a commit that references this issue on Oct 6, 2025
    d711fee
  9. added a commit that references this issue on Oct 23, 2025
    3dbcb7f
  10. added a commit that references this issue on Nov 10, 2025
    1bcf93d
  11. added 2 commits that reference this issue on Nov 29, 2025
    b37daee
    8ebb3d6
  12. avivkeller commented on Dec 3, 2025

    @avivkeller
    Member

    JSDoc keys (i.e. @name, @type) are used in the format.

    I'm not sure this makes it easier to consume. I feel like not knowing whether a prop has an @ prefix might make it harder, but maybe I'm wrong?

  13. ovflowd commented on Dec 3, 2025

    @ovflowd
    Member

    JSDoc keys (i.e. @name, @type) are used in the format.

    I'm not sure this makes it easier to consume. I feel like not knowing whether a prop has an @ prefix might make it harder, but maybe I'm wrong?

    It's just to be easily complaint with JSDoc and allow easy JSDoc generation, also I find these keys completely OK named.

  14. removed this from the Web Generator Migration milestone on Feb 28, 2026
  15. self-assigned this
    on Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Web Generator`web`, `jsx-ast`, and `orama-db`

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions