Repository navigation
ci(docs): generate OpenAPI at build time - #2475
Conversation
Signed-off-by: Miyoung Choi <miyoungc@nvidia.com>
|
Staged Fern docs preview: https://nvidia-preview-pr-2475.docs.buildwithfern.com/nemo/guardrails |
Signed-off-by: Miyoung Choi <miyoungc@nvidia.com>
[Medium impact] The PR appears safe to merge; the earlier comparison gap is fixed and no new actionable issues were found. SummaryGenerates the API reference from FastAPI during documentation builds, with curated examples and descriptions kept in a Fern overlay.
|
Signed-off-by: Miyoung Choi <miyoungc@nvidia.com>
Signed-off-by: Miyoung Choi <miyoungc@nvidia.com>
Signed-off-by: Miyoung Choi <miyoungc@nvidia.com>
Signed-off-by: Miyoung Choi <miyoungc@nvidia.com>
Signed-off-by: Miyoung Choi <miyoungc@nvidia.com>
Signed-off-by: Miyoung Choi <miyoungc@nvidia.com>
Signed-off-by: Miyoung Choi <miyoungc@nvidia.com>
Pouyanpi
left a comment
There was a problem hiding this comment.
thanks for this @miyoungc 🚀 generating OpenAPI directly from FastAPI removes a source of documentation drift while preserving the curated examples, nice use of overlays btw. the affected CI workflows all passed, including preview publishing, and I found no blocking issues.
Description
The API reference currently depends on a handwritten OpenAPI file that can drift from the FastAPI server. Generate the contract during documentation builds, alongside the Python SDK reference, so a source change updates the built API reference automatically. Contributors commit the source and curated documentation;
fern/openapi.ymlbecomes an ignored build artifact.fern/openapi-overlay.yml, and add/v1/checksto navigation..github/workflows/guardrails-api-spec.yml) to exercise generation and exporter tests. Keep both existing API Conformance workflows: Implementation remains unchanged; Docs now checks the generated, overlay-applied contract and compares it with the target revision for breaking changes. Upstream OpenAI compatibility gaps remain informational.Related Issue(s)
Tracking: SDR-1591. The request originated in Slack and is tracked on the SDR documentation board, as authorized by the directing contributor.
Verification
699f10bd2b51e1ab3ffac07830944dcaf7406f0d, with no pending or failed PR checks. Successful checks include Python 3.10–3.13 on Ubuntu, coverage, Guardrails API specification generation, both API conformance jobs, Fern validation and preview publishing, lint, zizmor, CodeQL, and Greptile. The separately dispatched Full Tests matrix previously passed all eight Windows/macOS combinations across Python 3.10–3.13 on22f56ec027fde7b9503ef17340d9097ed2f683e8, before the workflow naming follow-up. Staging publishing was intentionally skipped.npm run test:docs-scriptswith Node.js 22: 18 passed. Covers missing/stale artifacts, failure blocking undermake -j2, historical SDK caching and inherited Fern context, source-change watching, and native Fern compilation/export.make docs-fernwith Node.js 22 and the organization-required Fern CLI 5.167.0: passed, regenerating OpenAPI and 406 SDK pages with 0 errors and 566 existing warnings. The generated artifacts remain ignored and untracked.RailsConfigInfo.idfailed the pinned oasdiff check withresponse-required-property-removed, confirming overlay response changes are covered.The PR preview was published successfully. No staging or production publication was performed. The earlier Windows failures were reproduced by the full platform matrix, and the Fern 5.167.0 image-path failure was reproduced locally before the fix (7 errors) and cleared afterward (0 errors).
AI Assistance
OpenAI Codex implemented the exporter, overlay, build/workflow wiring, documentation, and regression tests, and ran local validation. Human review is pending.
Checklist
Summary by CodeRabbit
New Features
POST /v1/checksendpoint.Documentation