chore(codegen): daily schema refresh (2026-08-05) - #113
Draft
timgl wants to merge 1 commit into
Draft
Conversation
Regenerate src/generated/api.d.ts from the live PostHog OpenAPI spec and
realign the managed resource clients with upstream schema/route renames.
- endpoints: operationIds environments_endpoints_* renamed to endpoints_* and
route moved from /api/environments/{environment_id}/endpoints/ to
/api/projects/{project_id}/endpoints/. Updated openapi-filter.yaml and the
endpoint client paths/params accordingly.
- dashboard: partial_update request body schema PatchedDashboard renamed to
PatchedPatchedDashboardOpenApi.
- experiment: request/response schemas Experiment->ExperimentWrite,
PatchedExperiment->PatchedExperimentWrite, and
PaginatedExperimentList->PaginatedExperimentBasicList.
typecheck + test (291 tests) pass.
Generated-By: PostHog Code
Task-Id: 4936f0d4-b217-492a-850c-4a73d88b3732
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Daily regeneration of
src/generated/api.d.tsfrom the live PostHog OpenAPIspec (
https://us.posthog.com/api/schema/?format=json, filtered byopenapi-filter.yaml), plus the minimal client patches needed to realign themanaged resource families with upstream schema/route renames.
Why: automated daily schema-refresh detected drift in the live API spec; the
typed client must track it so
pnpm typecheck/pnpm teststay green.Spec diff size
src/generated/api.d.ts: +4424 / −1621 lines.Managed-family drift resolved
environments_endpoints_*→endpoints_*; route moved/api/environments/{environment_id}/endpoints/→/api/projects/{project_id}/endpoints/endpoint/client.tspaths + path params updatedPatchedDashboard→PatchedPatchedDashboardOpenApidashboard/client.tstype refExperiment→ExperimentWrite(create/update body),PatchedExperiment→PatchedExperimentWrite,PaginatedExperimentList→PaginatedExperimentBasicListexperiment/client.tstype refsoperationIds added to the filter
Replaced the six renamed endpoint ops (net-new to the allowlist):
endpoints_list,endpoints_create,endpoints_retrieve,endpoints_update,endpoints_partial_update,endpoints_destroy(removing the now-nonexistent
environments_endpoints_*— this is a rename inthe live spec, not a dropped capability.)
Resources touched
src/resources/endpoint/client.ts(route + params)src/resources/dashboard/client.ts(schema ref)src/resources/experiment/client.ts(schema refs)Disappeared operationIds
Only the six
environments_endpoints_*ops disappeared, and they were renamed(not removed) to
endpoints_*— handled above. No managed capability was dropped,so nothing needs a human deletion this cycle.
New operationIds NOT added (intentionally unmanaged)
openapi-filter.yamlis an allowlist, so the drift report lists the entire liveAPI surface (~1.7k ops) minus the managed families. These stay excluded — they
belong to products outside the IaC-managed scope (accounts, error tracking,
logs, warehouse, tasks, LLM analytics, messaging, etc.). Worth calling out: a few
are new full-
PUTcounterparts to families we already manage viapartial_update(
event_definitions_update,schema_property_groups_update,event_schemas_update/event_schemas_partial_update,experiment_holdouts_update,experiment_saved_metrics_update). The resource clients don't use them, so they'releft out to keep the generated surface minimal.
Verification
pnpm typecheck✅pnpm test✅ (291 tests)Pre-existing repo-wide
eslint/prettierwarnings are unrelated to this diff(present on
main) and left untouched.TaskRun
https://us.posthog.com/project/423401/tasks/4936f0d4-b217-492a-850c-4a73d88b3732
Created with PostHog Code