Repository navigation
refactor(specs): drop the x-appwrite.idGenerator extension - #13742
Merged
Merged
Conversation
The key is emitted on every CustomId parameter with the single constant value "ID.unique", so it carries no information beyond "this validator was CustomId", and an audit found no consumer reading it: not the SDK generator, not vibes, not the console, MCP, or the Terraform provider. Vibes classifies creatable resource IDs from the schema description instead, matching /choose a custom … id|generate a random id|ID.unique\(\)/ in isCreatableIdSchema(), and treats every path and query parameter as an existing-resource reference regardless. Of the 88 canonical sites, 80 are already matched by that regex and 7 of the remaining 8 are path parameters vibes excludes by rule, so removing the extension changes no consumer behaviour. This continues the OpenAPI3 standards cleanup: x-appwrite should hold only what OpenAPI cannot express, and a constant-valued flag with no reader does not qualify.
Contributor
|
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
loks0n
approved these changes
Sep 17, 2026
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
Removes the
x-appwrite.idGeneratorkey from the OpenAPI 3 producer. It was emitted on everyCustomIdparameter insrc/Appwrite/SDK/Specification/Format/OpenAPI3.php.Why
The key has a single constant value,
"ID.unique", across all 88 sites in the canonical document, so it says nothing beyond "this parameter's validator wasCustomId". An audit across every Appwrite repo found no consumer reading it — not the SDK generator, not vibes, not the console, MCP, or the Terraform provider. The only occurrences outside this repo are the published spec artifacts themselves.Vibes, the one place the flag would plausibly matter, identifies creatable resource IDs from the schema description instead.
isCreatableIdSchema()insrc/lib/api-explorer/request-form.tsmatches/(?:choose a custom .{0,40}? id|generate a random id|id\.unique\(\))/i, with a second copy inparse-spec.tsfor sample values, and path and query parameters are classified as existing-resource references regardless of the description.Comparing the two signals over the canonical document: 80 of the 88
idGeneratorsites are already matched by that regex, and 7 of the remaining 8 are path parameters ({linkId},{archiveId},{policyId},{documentId},{userId}/sessions) that vibes excludes by rule and that only carry the key becauseCustomIddoubles as a path validator. So no consumer behaviour changes.This continues the OpenAPI3 standards cleanup tracked in appwrite-labs/cloud#5799:
x-appwriteshould hold only what OpenAPI cannot express, and a constant-valued flag with no reader does not qualify.Testing
testOpenApiCustomIdBodyFieldIncludesIdGeneratorMetadatais renamed totestOpenApiCustomIdBodyFieldUsesGeneratedExampleand keeps its remaining assertions: the<USER_ID>example derived from the parameter name, and nox-example. TheidGeneratorassertion is dropped along with the emission rather than inverted.vendor/bin/phpunit tests/unit/SDK/Specification/FormatTest.php— 42 tests, 247 assertions, OKcomposer lint— Pint passedgit grep -i idgenerator— no remaining hitsFollow-up, not in this PR
The audit turned up one genuine gap in the vibes regex that this PR deliberately leaves alone:
POST /backups/restoration→newResourceId("Destination resource ID. Omit to restore the archived resource in place…") is a creatable ID the regex does not match, andPOST /organization/projects→projectIdmatches the regex but was never emittingidGenerator. Both are pre-existing and better fixed in vibes or in the parameter description than by keeping this extension.