Skip to content

fix: remove x-appwrite.produces from OpenAPI responses - #13524

Merged
ChiragAgg5k merged 2 commits into
mainfrom
clo-4377-produces
Sep 8, 2026
Merged

ChiragAgg5k merged 2 commits into
mainfrom
clo-4377-produces

Conversation

@ChiragAgg5k

@ChiragAgg5k ChiragAgg5k commented Sep 8, 2026 •

Copy link
Copy Markdown
Member

Stop emitting x-appwrite.produces

CLO-4377: https://linear.app/appwrite/issue/CLO-4377/openapi3-standards

PR 1/4. Follow-ups: [Cloud promotion — pending PR URL], [canonical specs — pending PR URL], SDK generator #1888.

Spec change

Actual Appwrite CLI output for DELETE /sites/{siteId}/logs/{logId} (sitesDeleteLog), before → after (excerpt):

 "responses": {
     "204": {
         "description": "No content"
     }
 },
 "x-appwrite": {
-    "produces": ["application/json"],
     ...
 }

No response body is invented for 204. Explicit JSON, text and binary response content is unchanged. Current Appwrite main emits OpenAPI3 only; no historical Swagger2 documents or producer were rewritten.

Validation

  • Ran php app/cli.php specs --version=2.0.x --mode=normal --git=no and the latest equivalent, before and after, from the same Appwrite base.
  • Each actual CE document has exactly two extension deletions (sitesDeleteLog, vcsUpdateExternalDeployments); every other parsed JSON value is identical. This is CE, not Cloud: the published Cloud document has 49 extension-bearing operations.
  • Both before/after documents pass swagger-parser validation; after document passes reference validation.
  • php -l and composer lint src/Appwrite/SDK/Specification/Format/OpenAPI3.php pass.
  • No new unit tests.

Rollout

After merge, record the real published Appwrite merge SHA A. Cloud must promote its server-ce lock to A (or a reviewed descendant), then regenerate canonical specs with Cloud overrides. Generator release waits for publication. Rust downstream changes are an intentional breaking correction and are documented in PR 4.

Captured validation output

Actual command-output excerpts rendered locally and captured with Chromium. These are test-log screenshots, not live browser UI/e2e screenshots. Local configuration paths are excluded by selecting the public stdout excerpt; result text is unchanged.

Captured command output

Revalidated after rebasing onto Appwrite main 5070d71d6cdf7b7c1c2d5796949480a17a238a66; prepared commit 0f40cfa24cbdd084c3371c6c5a14f00ecaecce8a. Both 2.0.x/latest before/after pairs still differ only by the two extension deletions and validate cleanly.

@greptile-apps

greptile-apps Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR stops emitting the nonstandard x-appwrite.produces fallback for operations whose responses declare no content.

  • Preserves response content metadata for responses that explicitly declare JSON, text, or binary content.
  • Updates the no-content formatter test to require omission of x-appwrite.produces.
  • The previously reported stale test expectation is fully fixed.

Confidence Score: 5/5

The PR appears safe to merge because the formatter behavior and its unit-test expectation now consistently omit the deprecated metadata.

The previously failing test expectation has been updated to match the intended formatter output, and no new correctness, security, or repository-rule issues remain.

Important Files Changed

Filename Overview
src/Appwrite/SDK/Specification/Format/OpenAPI3.php Removes the fallback that added x-appwrite.produces when no response declared content.
tests/unit/SDK/Specification/FormatTest.php Updates the no-content response test to assert that x-appwrite.produces is absent.

Reviews (2): Last reviewed commit: "test: expect bodyless specs without prod..." | Re-trigger Greptile

@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

✨ Benchmark results

Comparing main (before) → clo-4377-produces (after).

Metric Before After Change
🚀 Requests/sec 262.81 258.64 ⚪ -1.6%
⏱️ Latency P50 66.28 ms 67.71 ms ⚪ +2.2%
⏱️ Latency P95 152.85 ms 157.88 ms ⚪ +3.3%
Per-scenario breakdown & investigation details

Metrics below reflect the current branch (after). Δ P95 compares against the base.

Scenario P50 (ms) P95 (ms) Requests RPS Δ P95 (ms)
API total 67.71 157.88 15,960 258.64 +5.03
Account 140.31 232.01 840 14.35 -0.92
TablesDB 65.4 114.79 8,680 143.31 -0.72
Storage 62.48 136.51 4,200 71.24 +5.91
Functions 101.72 197.55 2,240 38.69 +8.26

Top API waits (after)

API request Max wait (ms)
account.name.update 342.56
functions.create 301.34
functions.variables.update 291.72
storage.buckets.create 288.56
functions.variables.delete 282.52

@ChiragAgg5k
ChiragAgg5k merged commit 7553598 into main Sep 8, 2026
87 of 88 checks passed
@ChiragAgg5k
ChiragAgg5k deleted the clo-4377-produces branch September 8, 2026 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants