Repository navigation
Fix effective SDK platform availability in OpenAPI specs - #13502
Conversation
Greptile SummaryThis PR aligns OpenAPI platform metadata and route selection with effective SDK availability.
Confidence Score: 5/5The PR appears safe to merge; no new correctness or security defects were identified, though the existing non-blocking request for focused availability regression coverage remains outstanding. The current changes consistently use effective method platforms during route selection and OpenAPI emission without breaking the formatter’s route iteration. The previous request for focused tests remains unresolved because the test changes only add console authentication to existing fixtures and still do not assert client/server eligibility, hidden methods, aliases, custom mappings, or emitted platform metadata. Important Files Changed
Reviews (2): Last reviewed commit: "refactor(specs): keep platform eligibili..." | Re-trigger Greptile |
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
Appwrite publishes one OpenAPI document per SDK platform, with the generator trusting each to be pre-filtered. appwrite/appwrite#13502 made the operation-level `x-appwrite.platforms` the effective availability and gave every method alias its own list, which lets one canonical document drive all three platforms once the generator selects from it. The generator now skips operations, aliases and security schemes whose `platforms` exclude `sdk.platform`. A missing list, or no platform, means available everywhere, and unknown names such as Cloud's `manager` never match. `example.php` sets the platform for every target, as production already does. Regenerating every target from the current client, server and console documents is byte-identical. Shape checks move out of the Docker e2e tests into a `Generation` suite that generates the fixture for every language and platform and checks the trees against declarative tables: excluded fixtures never appear, platform-bound fixtures appear on their platforms alone, enums are declared, Go model comments carry no HTML entities. The e2e suite keeps only runtime behavior. Related to CLO-4377.
What does this PR do?
Fixes
x-appwrite.platformsto match actual SDK availability:serverfrom OAuth2 session creation and usage events/gauges, where it is hidden.serverplatform to presence update/upsert.platformsto individual method aliases so their availability is explicit.This does not consolidate the three specs or change their filenames. Existing generated SDK output is unchanged.
Spec changes
Excerpts below omit unrelated fields.
OAuth2 session creation
GET /account/sessions/oauth2/{provider}already excludes server SDKs; its metadata now agrees:"x-appwrite": { - "platforms": ["console", "client", "server"] + "platforms": ["console", "client"] }Usage events/gauges similarly change from
["console", "server"]to["console"].Presence update — server spec
"operationId": "presencesUpdate", "x-appwrite": { - "platforms": ["client", "console"], + "platforms": ["client", "console", "server"], "methods": [ { "name": "update", "namespace": "presences", + "platforms": ["server"], "required": ["presenceId", "userId"] } ] }Presence update — client spec
"operationId": "presencesUpdate", "x-appwrite": { - "platforms": ["client", "console"], + "platforms": ["client", "console", "server"], "methods": [ { "name": "update", "namespace": "presences", + "platforms": ["client", "console"], "required": ["presenceId"] } ] }The
userIdrequirements are unchanged. The new metadata identifies the existing variants.Validation
Related to CLO-4377.