Objective
This workflow ensures thatdocs.json remains perfectly synchronized with the public Rhombus OpenAPI specification at: https://api2.rhombussystems.com/api/openapi/public.json.
It validates and updates documentation only using the official OpenAPI data—no speculative or hallucinated content. The process operates in controlled batches for large files, ensuring performance, consistency, and auditability.
Key Guardrails
- Single Source of Truth: The OpenAPI spec defines all endpoint and field content. Missing fields remain blank or receive a
TODOplaceholder—never invented. - Deterministic Merging: Custom fields in
docs.json(e.g., internal notes or examples) are preserved. Only OpenAPI-derived data is updated. - Schema Integrity: The resulting JSON structure undergoes validation before commit.
- Idempotency: Running the workflow multiple times without spec changes produces identical output.
- Scalable for Large Specs: Processes endpoints in configurable batches with progress indicators.
Directory Structure and File Conventions
- Cached OpenAPI file:
.cache/openapi-public.json - Update tool (auto-created if missing):
tools/update_docs_from_openapi.py - Input file:
docs/docs.json(existing structure preserved) - Temporary output:
docs/docs.next.json - Change log:
docs/api_sync_changelog.md
Workflow Summary
- Download and Cache the latest OpenAPI spec using conditional GET requests.
- Validate JSON structure and calculate the content hash.
- Normalize and Format parameters, request bodies, and responses—improving readability without altering meaning.
- Merge Changes into
docs.json:- Add new endpoints.
- Update existing endpoints.
- Retain any non-spec custom fields.
- Mark removed endpoints as
deprecated: truewith timestamped notes.
- Validate and Replace the existing
docs.jsonatomically after verification. - Generate a Changelog documenting added and updated endpoints.
- Commit and Branch automatically with a signed message, ready for PR creation.
Dependencies (Installed Automatically if Missing)
bashcurljqpython3(≥ 3.9)git
Execution Steps (Turbo Mode Recommended)
Improvement Policy (No Hallucination)
✅ Allowed:- Normalize whitespace and apply title case.
- Deduplicate tags and responses.
- Reformat existing summaries for consistency.
- Adding additional context or value to descriptions when confident
- Creating new endpoint descriptions.
- Inferring business logic or undocumented behavior.
- Adding or modifying examples unless they exist in the spec.
summary or description are missing, leave them blank or insert "description": "".
Configuration Parameters
BATCH_SIZE— Default: 75. Number of endpoints processed per batch.SLEEP_SEC— Default: 0.05s. Delay between batches for memory stability.