Skip to content

Feat: Improve GenTool JSON schema DX: autocomplete, markdown docs, and quick reference#132

Open
AdamMomen wants to merge 3 commits intoaukilabs:mainfrom
AdamMomen:feature/add-api-json-schema-generator
Open

Feat: Improve GenTool JSON schema DX: autocomplete, markdown docs, and quick reference#132
AdamMomen wants to merge 3 commits intoaukilabs:mainfrom
AdamMomen:feature/add-api-json-schema-generator

Conversation

@AdamMomen
Copy link

@AdamMomen AdamMomen commented Mar 10, 2026

Summary

Adds JSON Schema support for GenTool enum/interface definitions with validation, IDE autocomplete, and documentation.

Changes

Schema & validation

  • gentool.schema.json — JSON Schema (draft 2020-12) for enum and interface definitions
  • validate-schemas.js — Validates all enum/*.json and interface/*.json against the schema
  • .github/workflows/gentool-schema.yml — CI workflow that runs schema validation on PRs
  • .vscode/settings.json — Associates the schema with enum/interface JSON files for VS Code

Type autocomplete

  • generate-schema-fragment.js — Generates gentool.schema.generated.json with enum values for parameterized types (CLASS_MIX:Vector3, ENUM:SolvePnPMethod, ARRAY_REF:float, etc.)
  • gentool.schema.generated.json — Generated file (committed); updated by npm run generate
  • Schema uses $ref to the generated enums for autocomplete instead of regex patterns
  • Property definitions include markdownDescription for richer hover text in VSCode/Cursor

Scripts & workflow

  • npm run generate — Runs code generation and schema fragment generation
  • npm run validate:schemas — Validates enum/interface JSON against the schema

Documentation

  • sdk/gentool/README.md — Quick reference: scripts, workflow, schema overview, common property patterns

Screenshots

  • IDE Schema Validation
image
  • IDE Completion (Cursor)
image

- Introduced a GitHub Actions workflow for validating GenTool JSON schemas.
- Added `gentool.schema.json` to define the schema for enum and interface JSON files.
- Updated `package.json` to include a new script for schema validation.
- Created `validate-schemas.js` to run schema validation using AJV.
- Updated VSCode settings to recognize the new JSON schema.
…tion

- Added `generate-schema-fragment.js` to generate `gentool.schema.generated.json` with enum values for parameterized types.
- Updated `package.json` to run the new schema generation script as part of the `generate` command.
- Enhanced `gentool.schema.json` with markdown descriptions for better documentation.
- Modified `validate-schemas.js` to validate against the generated schema and strip IDE-specific keywords for compatibility.
- Added quick reference section for scripts and workflow for adding new interfaces or enums.
- Included details on schema files and IDE support for better developer guidance.
- Expanded common property patterns with examples for clarity.
Copy link
Author

@AdamMomen AdamMomen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Self-Reviewed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant