|
| 1 | +# WorkOS Python SDK — Agent Context |
| 2 | + |
| 3 | +Most code in this repository is **auto-generated**. It is emitted by the |
| 4 | +oagen pipeline from the WorkOS OpenAPI spec. It is not hand-written here, |
| 5 | +and most bugs in it cannot be fixed here. |
| 6 | + |
| 7 | +## The generation pipeline |
| 8 | + |
| 9 | +| Repo | Role | |
| 10 | +| --- | --- | |
| 11 | +| [workos/openapi-spec](https://github.com/workos/openapi-spec) | Source of truth for the API surface (the OpenAPI spec, exported by the WorkOS API) and the orchestration entrypoint for all SDK generation | |
| 12 | +| [workos/oagen](https://github.com/workos/oagen) | The generator engine (spec → IR → code) | |
| 13 | +| [workos/oagen-emitters](https://github.com/workos/oagen-emitters) | The per-language emitters, including the Python emitter that produces this repo's code | |
| 14 | + |
| 15 | +Regeneration runs from a checkout of `openapi-spec`, never from this repo: |
| 16 | + |
| 17 | +```bash |
| 18 | +npm run sdk:generate -- --lang python --output workos-python |
| 19 | +``` |
| 20 | + |
| 21 | +## Generated vs. hand-maintained code |
| 22 | + |
| 23 | +- Generated files begin with the header `# This file is auto-generated by oagen. Do not edit.` — treat them as build artifacts. |
| 24 | +- Hand-maintained code is fenced with `@oagen-ignore-start` / `@oagen-ignore-end` markers, or lives in files marked `@oagen-ignore-file`. Only this code is editable in this repo. |
| 25 | + |
| 26 | +## Where to fix an issue |
| 27 | + |
| 28 | +| Symptom | Fix it in | |
| 29 | +| --- | --- | |
| 30 | +| Wrong or missing endpoint, field, type, or enum value | [workos/openapi-spec](https://github.com/workos/openapi-spec) (or the WorkOS API that exports the spec) | |
| 31 | +| Generated Python code is broken or un-idiomatic | [workos/oagen-emitters](https://github.com/workos/oagen-emitters) | |
| 32 | +| Generator behavior: naming, IR, pagination, compat checks | [workos/oagen](https://github.com/workos/oagen) | |
| 33 | +| Code inside `@oagen-ignore` fences or ignore-marked files | This repo — edit normally | |
| 34 | + |
| 35 | +Don't hand-edit a file that has the generated header — the next |
| 36 | +`sdk:generate` run silently overwrites it. Instead, fix the emitter or the |
| 37 | +spec upstream and regenerate. If a requested fix lands in a generated file, |
| 38 | +say so and point at the upstream repo rather than patching it here. |
0 commit comments