Internals

Scripts

Read this page when maintaining API schema tracking and generated index artifacts.

Script Inventory

ScriptPurposeInputsOutputs
scripts/sync_openapi.pyFetch latest OpenAPI schema--url, --out, --metadata, env token/urlopenapi/openapi.json, openapi/metadata.json
scripts/generate_openapi_index.pyBuild compact operation list for diff/review--schema, --outsrc/rsspot/generated/openapi_index.py

Operational Guardrails

  • Run sync_openapi.py before regenerating index.
  • Commit schema, metadata, and generated index together to keep review coherent.
  • Treat failed fetches as blocking events for API-surface updates.
  • Keep generated file header intact (Generated by scripts/generate_openapi_index.py).

Suggested Maintenance Routine

uv run python scripts/sync_openapi.py
uv run python scripts/generate_openapi_index.py
git diff -- openapi src/rsspot/generated/openapi_index.py

If the diff is large, split review into:

  1. schema/operation changes
  2. corresponding SDK model/service changes