nodejs / nodejs/doc-kit

New JSON generator schema

Open
#214 6 comments 3 reactions 2 assignees View on GitHub

@avivkeller is already working on this.

Since Sep 15, 2026.

Web Generator
Dominant language
JavaScript
Stars
64
Forks
71
Avg merge
2d 17h
Merged PRs (30d)
31

Description

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, nodejs/api-docs-tooling#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:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.