Repository navigation
fix: replace compound x-mapping with constrained unions - #13577
Merged
Merged
Conversation
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
ChiragAgg5k
marked this pull request as ready for review
September 9, 2026 12:24
Contributor
loks0n
approved these changes
Sep 9, 2026
2 of 4 tasks
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.
Summary
Producer change for CLO-4377, following merged sdk-generator#1894 and released SDK-generator 5.0.0.
The consumer was admin-merged as
8ea7dcd534718ca6acf14be8b4ae10dfc5c9c1fcafter all 59 checks passed and Greptile reached 5/5 with zero unresolved threads on reviewed head137960eca041d842e5bccd8e70fea1564e7b0bec. The merge tree matches that head. GitHub and Packagist both publish 5.0.0 from this merge.Update Appwrite's dev dependency from
appwrite/sdk-generator: ^4.0to^5.0; the lock moves 4.9.0 → 5.0.0 and OpenAPI 0.2.1 → 0.2.4. No other package versions changed. OpenAPI^0.2.4is also a direct runtime dependency:Formatuses itsCompositionenum rather than composition-name strings. The lock moves OpenAPI into production packages without changing its version. The broader changes since generator 4.9.0 must also be considered in the eventual Cloud artifact/delta review; the earlier compound-only comparison does not cover that full dependency jump.Replace compound discriminator
x-mappingwith standard constrainedanyOfbranches. Apply the same union builder to response unions and model-property/item unions. Keep ordinary valid single-property discriminators and unconstrained unions unchanged.Before:
After:
Broad String overlaps Email/Enum/URL/IP, so these must be inclusive
anyOfalternatives, not exclusiveoneOf. There is no lossy compound discriminator or synthetic public model. Referenced models are unchanged; conditions become required singleton-enum constraints. SDK selection remains most-specific-first in the consumer.Verification
vendor/bin/phpunit tests/unit/SDK/Specification/FormatTest.php: 42 tests / 248 assertions passed. At the owner's request, the added tests are reduced to one focused String/Email overlap test. It parses the emitted document and verifies inclusive composition, absent compound discriminator, model identities and selection conditions. No added data provider or separate discriminator test remains.composer lint src/Appwrite/SDK/Specification/Format.php src/Appwrite/SDK/Specification/Format/OpenAPI3.php tests/unit/SDK/Specification/FormatTest.php: passed.composer refactor:check tests/unit/SDK/Specification/FormatTest.php: passed.vendor/bin/phpstan analyse src/Appwrite/SDK/Specification/Format.php src/Appwrite/SDK/Specification/Format/OpenAPI3.php --memory-limit=1G: passed.git diff --check: passed.Composition. Full configured Rector and targeted PHPStan pass.x-mapping; generated-source assertions were removed during review. Candidate specs generated with the no-x-mappingreader match saved pre-removal output for 17 targets. That broad comparison uses a local transformation of pinned canonical specs, not a full Cloud build of this producer; details are in the generator PR.composer validate --no-check-publishpasses. The installed released generator 5.0.0 successfully generated a PHP SDK from an actual producer-emitted fixture document; every generated PHP source file passesphp -l. Dependencies were installed locally with--ignore-platform-reqs --no-scripts --no-plugins; this is not full-stack runtime verification.Backend/schema output only; screenshots are not applicable.
Remaining merge/publication gates
The owner explicitly requested no
x-mappingfallback in the generator and support scoped to the string conditions currently needed inappwrite/specs. The generator PR removes that reader entirely. Published old compound specs therefore require coordinated migration; they are not claimed compatible with the new reader.push=falsegeneration and inspect the actual artifacts/delta before canonical publication.OpenAPI 0.2.4 and SDK-generator 5.0.0 are released; Vibes support is merged separately. This PR does not directly edit
appwrite/specs, publish specs, deploy the generator to Cloud, or release Appwrite. Unrelated strict full-document validation failures remain deferred, not passing. No full Cloud generation, deployed-consumer, or all-language runtime claim is made here.