Repository navigation
Commit c0c9994
fix: patch app-installations anyOf in place instead of replacing the operation (#544)
* Fix stale team_discussions in app-installations overrides
The override files for /app/installations contained a stale copy
of the app-permissions schema that used team_discussions instead of
discussions. The upstream schema (rest-api-description) was updated
from team_discussions to discussions, but these hardcoded overrides
were never updated to match.
This caused @octokit/openapi consumers to see team_discussions
instead of discussions in the app-permissions schema.
* Resync app-permissions overrides with current API schema
Update the frozen permission snapshots in override files to include
all current GitHub API permissions. Beyond the team_discussions to
discussions rename, this adds 20 missing permissions including:
artifact_metadata, attestations, codespaces, merge_queues,
dependabot_secrets, interaction_limits, email_addresses,
organization_copilot_agent_settings, organization_copilot_seat_management,
organization_custom_org_roles, organization_custom_properties,
organization_events, enterprise_custom_properties_for_organizations,
custom_properties_for_organizations, repository_custom_properties,
followers, git_ssh_keys, gpg_keys, profile, and starring.
* Refactor app-installations override to patch anyOf in-place
Replace the full-operation override for /app/installations with a
targeted in-place patch that only fixes the anyOf issues in the
account field. This allows the permissions block to flow through
from the upstream schema automatically, preventing drift when new
permission scopes are added.
Also adds a null guard for requestBody schemas that lack an
application/json schema property, fixing a pre-existing issue with
newer upstream specs.
* Fix anyOf patch to handle suspended_by and account nullable
The previous implementation only converted account's anyOf to allOf but
missed two things:
1. account: add nullable:true and remove type:[null,object] array to
match OpenAPI 3.0 nullable pattern
2. suspended_by: convert anyOf [{type:null}, SimpleUser] to the
SimpleUser entry with nullable:true
Also adds a reusable anyOfToNullable() helper for the null-union pattern.
* Add override assertions to catch upstream schema drift
Tests validate the generated output after overrides are applied:
- account: must be allOf (not anyOf) with nullable:true
- suspended_by: must be flat nullable object (not anyOf)
- permissions: must have known keys with valid enum values
- Cross-file check: no residual anyOf on patched fields
- Request body anyOf filtering: no non-object types
Runs 219 assertions across all generated schemas.
Wired into npm test so CI catches regressions.
* style: prettier
* build: regenerate schemas with in-place app-installations patch
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018cDR6tMPCpxwsiok8SgHd6
* Empty commit to trigger tests
---------
Co-authored-by: Salman Muin Kayser Chishti <[email protected]>
Co-authored-by: wolfy1339 <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>1 parent da1aaff commit c0c9994
15 files changed
Lines changed: 1349 additions & 5017 deletions
Large diffs are not rendered by default.
0 commit comments