Repository navigation
feat: derive optional security from OpenAPI alternatives - #1891
Merged
Merged
Conversation
ChiragAgg5k
marked this pull request as ready for review
September 8, 2026 18:54
Contributor
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.
Owner-approved scope deferral
The owner approved deferring the remaining pre-existing schema issues and continuing this migration. Strict full-document validation still fails on the documented custom-array schemas; that failure is deferred, not fixed or passing. No additional schema-cleanup work is included in this rollout.
Proceed with the optional-security migration's review/CI and coordinated producer → Cloud/specs → generator release steps. Keep the temporary producer dependency pin and SDK compatibility/release sequencing explicit; this deferral is not approval to disable checks or merge unrelated fixes.
Latest verification — includes enum-default fix #13545 (now merged)
Cloud head
12abbfeab6fd35ddccb669cd43cf8d55eb407068locks producer integration commite36198300f0efe854d442526253ae2b7eab2c2fb, which includes #13545's code.eb9761f869119e57c2f01e3eca3ec12e5bcda9e87ec5bfc8f6750bc4190d1001.[] is not of type 'string'. The same failure category exists in the published document.resourceon authorize GET/POST, device authorization, PAR, and token; WAFconditionson bypass, challenge, deny, rate-limit, and redirect creation. Their source validators declare arrays (Multiple(..., TYPE_ARRAY)and WAFConditions), but the producer's fallback maps them to string. Removing defaults alone would hide the underlying type mismatch.No PRs merged by this verification, no spec publication or deployment. The release gate remains blocked on these custom-array schema mappings and the previously listed SDK compatibility checks. Earlier sections below are historical evidence.
Latest verification — includes merged #13544
Producer #13543 now includes main through
f66db6e969(merged object-default fix); heade4d63346abff7a70f04c820862b2d285e66b2595. Cloud #5716 locks that producer commit at Cloud head6f68bc428.composer validate --no-check-publishpasses; only the server-ce lock reference changed.a5fad5d320ab9592181451b7c479f5d85f603f6d895a829f353374fea81694bb.[]to{}, with no other parsed differences. The optional-security migration is unchanged.openapi-spec-validatornow gets past the empty-object-default failure but fails on screenshottimezone:GET /avatars/screenshots, parameter index 9, hasdefault: ""outside its titledoneOftimezone enum. This field is unchanged from the previous artifact. Full spec validation remains blocked, not passing.Summary
Part of CLO-4377. Companion producer: appwrite/appwrite#13543.
utopia-php/openapi ^0.2.2and lock 0.2.2, which provides accepted/required security scheme names.security[0].x-appwrite.authas the separate source of example configuration, including candidates not referenced by API security.Appwrite::OPTIONALand direct legacy extension checks from 17 example templates.No OAuth scopes are merged. Generic security semantics live in OpenAPI 0.2.2, not in a generator helper.
Rollout gate
Do not release against the currently published old specs. Removing the legacy checks changes impersonation examples until the replacement security alternatives are published. Keep this draft until genuine Cloud generation, structural/live-spec baseline comparisons, and deployed-generator compatibility checks are complete. Coordinate producer promotion and canonical
2.0.x/latestpublication before releasing this generator.No Cloud promotion, specs publishing, or releases were performed.
Verification
Passing:
vendor/bin/phpunit --testsuite Generation— 91 tests, 1,154 assertions, 4 skipped.vendor/bin/phpunit tests/e2e/PHP85Test.php— 1 test, 145 assertions against the Docker mock API.composer refactor:check— passed.composer lint-twig— 586 files, zero errors.vendor/bin/phpcs src/SDK/SDK.php src/SDK/Extension/Appwrite.php tests/generation/GenerationTest.php— passed.git diff --check— passed.SDK_GEN_SPEC_FILE=$PWD/tests/resources/spec-openapi3.json php example.php <target> <platform>for PHP, Unity, Web, Node, Ruby, Python, Dart, Flutter, React Native, Go, Swift, Apple, .NET, Android, Kotlin, Rust, and CLI. Inspected the PHP example: Project/Key retained, optional Session omitted.gofmtcheck passed on the initial generated trees.Blocked / incomplete:
general.tsand several Node model files. Compared generatedsrc/files against an isolated unchanged-HEAD generation using the same fixture: no source differences. These failures predate this change. Chained lint/typecheck/test commands therefore did not run.The passing PHP e2e uses fixture generation, not the new full Appwrite/Cloud document.
Subsequent genuine Cloud verification
Cloud #5716: non-publishing specs runs passed for 2.0.x and latest. Both artifacts are byte-identical, SHA256
5454c86362e1ee39d0eaa0d1f1282d965b334041824bc047336fe262a6c27740.A controlled producer-parent run, using the same Cloud code, proves exactly 3 optional-extension removals and 16 security-array changes, with no other parsed differences. PHP SDK client/server/console complete trees match old generator
3418a5dbd+ genuine baseline versus this PR9e1423673+ genuine candidate, using isolated generator source autoloading and clean output directories.The artifacts have 1,022 operations, 77 aliases, and 16 schemes. Differences from the published 1,020-operation spec include independent OAuth/DNS changes, also present in the controlled baseline. Strict OpenAPI validation still fails on an object schema with
default: [], as does the published spec. Cross-language parity and deployed-generator compatibility remain pending. No screenshots apply to these nonvisual changes.