Overview
The Simple JSON generator creates a simplified JSON representation of the API documentation. This generator is designed for debugging and testing purposes rather than production use.This generator produces a single consolidated JSON file with all API documentation, making it ideal for debugging but not suitable for production deployment.
Metadata
Generator identifier
Generator version
Requires metadata generator output as input
Configuration
Output directory path for the generated JSON file
Enable JSON minification (removes whitespace and indentation)
Output Format
The generator produces:- Single file:
api-docs.jsoncontaining all API documentation - Format: Array of simplified metadata entries
- Indentation: 2 spaces (unless minified)
Usage
Dependency Chain
- ast - Parses Markdown to AST
- metadata - Extracts API metadata
- json-simple - Converts to simplified JSON
Implementation Details
The generator:- Deep clones content nodes to avoid affecting upstream nodes
- Removes redundant nodes using
unist-util-remove:- Stability nodes (already in metadata)
- Heading nodes (already represented in metadata)
- Maps input to simplified structure
- Writes consolidated output to
api-docs.json
Content Cleaning
The generator removes:- Stability indicators: Already captured in entry metadata
- Headings: Already represented in the heading structure
src/generators/json-simple/