chore(codegen): daily schema refresh (2026-08-04) - #112
Draft
timgl wants to merge 1 commit into
Draft
Conversation
Regenerate src/generated/api.d.ts from the live PostHog OpenAPI spec and
patch managed resources for drift.
- endpoints resource relocated from /api/environments/{environment_id}/endpoints/
to /api/projects/{project_id}/endpoints/ (operationIds renamed
environments_endpoints_* -> endpoints_*); update filter + client paths.
- dashboards PATCH body schema renamed PatchedDashboard ->
PatchedPatchedDashboardOpenApi.
- experiments write schemas renamed Experiment -> ExperimentWrite,
PatchedExperiment -> PatchedExperimentWrite, and list response
PaginatedExperimentList -> PaginatedExperimentBasicList.
Generated-By: PostHog Code
Task-Id: 41e15d0c-07df-4dfd-8fc5-57a2dfacc664
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.
Daily OpenAPI schema refresh (2026-08-04)
Automated regeneration of
src/generated/api.d.tsfrom the live PostHog OpenAPIspec, plus the minimal client patches needed to keep the managed resources
compiling against the new schema.
Why: The daily drift check flagged that
api.d.tschanged against the livespec. Left unpatched, three managed resources (endpoint, dashboard, experiment)
fail
pnpm typecheckbecause upstream renamed schemas and relocated a route.Spec diff size
src/generated/api.d.ts: +3928 / −1572 lines (regenerated, not hand-edited).Drift resolved
/api/environments/{environment_id}/endpoints/→/api/projects/{project_id}/endpoints/; operationIds renamedenvironments_endpoints_*→endpoints_*openapi-filter.yaml; repointed the five calls inendpoint/client.tsto the project path.endpoints_retrievenow returnsEndpointVersionResponse(a superset ofEndpointResponse), sotoServerEndpointstays compatible.PatchedDashboard→PatchedPatchedDashboardOpenApiPatchedDashboardBodytype alias.Experiment→ExperimentWrite,PatchedExperiment→PatchedExperimentWrite; list responsePaginatedExperimentList→PaginatedExperimentBasicListNew operationIds added to the filter
None as brand-new managed capabilities. The only filter change is the endpoint
rename above (
endpoints_list/create/retrieve/update/partial_update/destroy),which replaces the vanished
environments_endpoints_*ids for the same,already-managed resource.
The drift job's "new operationIds" list is the full set-difference between the
entire live API and our curated allowlist (~thousands of ids: analytics, admin,
per-product, and read-only endpoints). None represent a new CRUD sibling of an
existing managed family, and none are a brand-new resource family worth managing
under this IaC tool, so nothing else was pulled in.
Disappeared operationIds
environments_endpoints_{list,create,retrieve,update,partial_update,destroy}nolonger exist in the live spec. These were not deleted blindly — they are a
rename/relocation of the endpoint resource and were migrated to
endpoints_*asdescribed above. No other managed operationId disappeared.
Unresolved drift
None.
pnpm typecheckandpnpm test(291 tests) both pass. The endpointresource's description-marker safety invariant is untouched (only route paths
changed).
Notes
src/generated/api.d.tswas regenerated viapnpm codegenonly — nothand-edited (it is
.prettierignored by design).eslint/prettierwarnings are unrelated to thischange and present on
main.Originating TaskRun: https://us.posthog.com/project/423401/tasks/41e15d0c-07df-4dfd-8fc5-57a2dfacc664
Created with PostHog Code