Skip to content

Automate docs/openapi.json#1190

Merged
jealous merged 3 commits into
MemMachine:mainfrom
sscargal:feature/automate-openapi-generation
Mar 10, 2026
Merged

Automate docs/openapi.json#1190
jealous merged 3 commits into
MemMachine:mainfrom
sscargal:feature/automate-openapi-generation

Conversation

@sscargal

@sscargal sscargal commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

Purpose of the change

This change adds metadata tags (categories) to the FastAPI server endpoints. These tags are used to auto generate the openapi.json that is required for the public documentation on docs.memmachine.ai. This PR also includes automation to pull the latest MemMachine Platform API (openapi.json) and store it as docs/platform.openapi.json that is also displayed in the public docs.

Description

As stated above. This solves the problem of humans needing to manually generate the openapi.json each time the APIs are modified, or at release time.

It's critical to organize the API endpoints for developer friendly organization and findability.

Fixes/Closes

Fixes #317

Type of change

  • New feature (non-breaking change which adds functionality)
  • Documentation update
  • Project Maintenance (updates to build scripts, CI, etc., that do not affect the main project)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.

  • Manual verification (list step-by-step instructions)

Test Results: [Attach logs, screenshots, or relevant output]

The scripts have been tested and the resulting openapi.json and platform.openapi.json tested and validated in an offline Mintlify dev environment.

Checklist

  • I have signed the commit(s) within this pull request
  • My code follows the style guidelines of this project (See STYLE_GUIDE.md)
  • I have performed a self-review of my own code
  • I have commented my code
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes
  • I have checked my code and corrected any misspellings

Maintainer Checklist

  • Confirmed all checks passed
  • Contributor has signed the commit(s)
  • Reviewed the code
  • Run, Tested, and Verified the change(s) work as expected

Screenshots/Gifs

N/A

Further comments

N/A

Signed-off-by: Steve Scargall <37674041+sscargal@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR improves API documentation automation by adding FastAPI route tags for clearer grouping in generated OpenAPI output, enhancing the OpenAPI generation script, and adding CI workflows to keep both the OSS and Platform OpenAPI specs up to date for the public docs site.

Changes:

  • Add explicit tags=[...] metadata across API v2 routes to produce categorized OpenAPI output.
  • Replace/upgrade the OpenAPI generation script to normalize info, clean/disambiguate operationIds, sort paths, and inject examples.
  • Add GitHub Actions workflows to auto-regenerate docs/openapi.json and to periodically sync docs/platform.openapi.json.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/server/src/memmachine_server/server/api_v2/router.py Adds per-endpoint tags to improve OpenAPI grouping; includes System tag endpoints.
packages/server/src/memmachine_server/server/api_v2/config_router.py Moves away from router-level tags to per-endpoint tags to support mixed grouping (Configuration vs Resources).
docs/tools/generate_unified_openapi.py Removes an older unified OpenAPI generator script.
docs/tools/generate_openapi.py Expands generation logic (version normalization, operationId cleanup/disambiguation, tag metadata, path ordering, examples).
docs/openapi.json Updates committed OpenAPI output to the newly generated, tagged, and enriched spec.
.github/workflows/generate-openapi.yml Adds automation to regenerate docs/openapi.json on relevant main changes and open a PR if it differs.
.github/workflows/sync-platform-openapi.yml Adds automation to download and PR-update docs/platform.openapi.json on schedule/release.
.github/workflows/docs-checks.yml Validates platform.openapi.json (if present) with Mintlify in CI.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/server/src/memmachine_server/server/api_v2/router.py Outdated
sscargal and others added 2 commits March 10, 2026 11:53
Signed-off-by: Steve Scargall <37674041+sscargal@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Steve Scargall <37674041+sscargal@users.noreply.github.com>

@SarahScargall SarahScargall left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM - we can use this immediately with the updates to PR #1200.

@jealous jealous merged commit 662a83b into MemMachine:main Mar 10, 2026
44 checks passed
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.

[Feat]: Automate 'docs/openapi.json' generation from 'src/memmachine/server/app.py' on each release

4 participants