chore(codegen): daily schema refresh (2026-07-24) - #98
Draft
timgl wants to merge 1 commit into
Draft
Conversation
Regenerate src/generated/api.d.ts from the live PostHog OpenAPI spec and
patch drift caused by upstream schema renames.
- endpoints moved from environment-scoped to project-scoped
(environments_endpoints_* → endpoints_*); added the new operationIds to the
filter and repointed the endpoint client at /api/projects/{project_id}/endpoints/
- PatchedDashboard → PatchedPatchedDashboardOpenApi (dashboard PATCH body)
- PaginatedExperimentList → PaginatedExperimentBasicList (experiment list)
- PatchedExperiment → PatchedExperimentWrite (experiment PATCH body)
Generated-By: PostHog Code
Task-Id: 666d3e8e-6088-4476-a46b-3376faf8becd
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.
Why
Daily automated OpenAPI schema refresh. The live PostHog spec drifted from our
generated types (
src/generated/api.d.ts), so the typed client neededregenerating and a few upstream renames patched to keep
typecheck/testgreen.Spec diff size
src/generated/api.d.ts: +3597 / −1608 lines (17,571 → 19,548). No handedits — regenerated via
pnpm codegen.New operationIds added to the filter
The endpoints resource we manage was renamed and re-scoped upstream — from
environment-scoped
environments_endpoints_*(/api/environments/{environment_id}/endpoints/)to project-scoped
endpoints_*(/api/projects/{project_id}/endpoints/). Addedto
openapi-filter.yaml:endpoints_listendpoints_createendpoints_retrieveendpoints_updateendpoints_partial_updateendpoints_destroyEverything else in the daily drift report is non-CRUD action endpoints on
resources we already manage (e.g.
insights_activity_retrieve,dashboards_collaborators_*,experiments_duplicate_create) or brand-newresource families we deliberately do not manage (accounts, agents, surveys,
logs, warehouse, error-tracking, …). None are needed for the current
declarative resource set, so they're intentionally left out of the filter.
Resources touched
/api/projects/{project_id}/endpoints/(path param
environment_id→project_id). Detail GET now returnsEndpointVersionResponse(a structural superset ofEndpointResponse), whichremains compatible with the client's field projection.
PatchedDashboard→PatchedPatchedDashboardOpenApi.PaginatedExperimentList→PaginatedExperimentBasicList;PATCH body type
PatchedExperiment→PatchedExperimentWrite.Unresolved drift (needs a human decision)
environments_endpoints_*operationIds disappeared from the livespec (renamed, not genuinely removed). Per the refresh policy of not
auto-removing disappeared ids, they were left in
openapi-filter.yaml(annotated) where they now match nothing. A human should delete these 6
stale entries once satisfied the rename is permanent:
environments_endpoints_list,environments_endpoints_create,environments_endpoints_retrieve,environments_endpoints_update,environments_endpoints_partial_update,environments_endpoints_destroy.Validation
pnpm codegen✅pnpm typecheck✅pnpm test✅ (291 passed)(Pre-existing repo-wide
lint/prettierwarnings are untouched — not introducedby this change.)
TaskRun:
666d3e8e-6088-4476-a46b-3376faf8becdCreated with PostHog Code