This folder contains helper utilities that aren't part of the runtime firmware but assist with development workflows.
This script renders the OpenAPI schemas for every API version supported by openscan_firmware.
- It ensures the repo root is on
sys.pathso the package can be imported without installation. - It imports
make_version_app,SUPPORTED_VERSIONS, andLATESTfromopenscan_firmware.main. - For each version in
SUPPORTED_VERSIONS, it instantiates the corresponding FastAPI app and writesscripts/openapi/openapi_v<VERSION>.json. - It additionally produces alias files:
openapi_latest.json(points to the version marked asLATEST)openapi_next.json(always generated from thenextrouter)
Run the script from the repo root (the script adjusts sys.path, so no extra install step is required):
python scripts/generate_openapi_json.pyAll artifacts land in scripts/openapi/. Commit these files when you change API routes or schemas so downstream clients can stay in sync.
The script has no CLI switches. Behavior is driven by the firmware code:
SUPPORTED_VERSIONScontrols which/vX.Y/routers get exported.LATESTselects the version used foropenapi_latest.json.- The
nextalias is always generated to reflect the bleeding-edge router.
If you need to add knobs (e.g., output path, specific versions), extend the script and document the new options here.