|
1 | 1 | # Canonical OpenAPI Document |
2 | 2 |
|
3 | | -This directory is the source of truth for every SDK repository. |
| 3 | +This directory is the source of truth for the Python SDK. |
4 | 4 |
|
5 | 5 | Expected files: |
6 | 6 |
|
7 | | -- `openapi/justserpapi.openapi.json`: the canonical OpenAPI document that drives Python, Java, and Go generation. |
8 | | -- `openapi/baseline/justserpapi.openapi.json`: the last released spec snapshot used for breaking-change checks. |
| 7 | +- `openapi/justserpapi.openapi.json`: the canonical OpenAPI document that drives Python SDK validation and generation. |
| 8 | +- `openapi/baseline/justserpapi.openapi.json`: the previous released spec snapshot used for breaking-change checks. |
9 | 9 |
|
10 | 10 | If the canonical spec is not committed, CI is expected to fetch it with `python scripts/sdkctl.py fetch-spec` and cache it as a workflow artifact. |
11 | 11 |
|
12 | | -Bootstrap flow: |
| 12 | +When the API changes: |
13 | 13 |
|
14 | 14 | 1. Export or fetch the latest OpenAPI document into `openapi/justserpapi.openapi.json`. |
15 | 15 | 2. Run `python scripts/sdkctl.py validate-examples`. |
16 | 16 | 3. Run `python scripts/sdkctl.py validate-spec`. |
17 | | -4. Run `python scripts/sdkctl.py generate --clean`. |
18 | | -5. Run `python scripts/sdkctl.py sync-repos --push --tag` once the generated outputs look correct. |
| 17 | +4. Run `python scripts/sdkctl.py breaking-check` if `openapi/baseline/justserpapi.openapi.json` exists. |
| 18 | +5. Run `python scripts/sdkctl.py generate --clean`. |
| 19 | +6. If the spec is the next release candidate, copy it to `openapi/baseline/justserpapi.openapi.json` after validation. |
19 | 20 |
|
20 | 21 | If the API spec is protected, fetch it with: |
21 | 22 |
|
22 | 23 | ```bash |
23 | 24 | JUSTSERPAPI_API_KEY=... python scripts/sdkctl.py fetch-spec |
24 | 25 | ``` |
25 | 26 |
|
26 | | -The repo currently ships test fixtures under `tests/fixtures/` so CI can exercise the orchestration code even when the canonical spec must be fetched at workflow time. |
| 27 | +Release reminder: |
| 28 | + |
| 29 | +- `openapi/justserpapi.openapi.json` should describe the next release |
| 30 | +- `openapi/baseline/justserpapi.openapi.json` should describe the last published release |
| 31 | +- if `info.version` changes, keep `justserpapi/_version.py` in sync before tagging |
| 32 | + |
| 33 | +The repo ships test fixtures under `tests/fixtures/` so CI can exercise the tooling even when the canonical spec must be fetched at workflow time. |
0 commit comments