fix: infer response media and Rust bodyless results from OpenAPI - #1888
Conversation
Greptile SummaryThis PR derives response media types from standard OpenAPI response content, defaults bodyless operations to JSON content negotiation, and updates Rust bodyless operations to return unit.
Confidence Score: 5/5The PR appears safe to merge with no outstanding correctness or repository-rule findings. No new code changes were made after the previous review, and the sole previous finding was manually resolved after Greptile conceded it: Important Files Changed
Reviews (3): Last reviewed commit: "chore: leave Rust changelog template unc..." | Re-trigger Greptile |
|
@greptile review |
|
@greptile review Please reassess the resolved case-mismatch finding with the actual assertion input: |
Derive Accept and Rust response types from standard response content
PR 4/4. CLO-4377: https://linear.app/appwrite/issue/CLO-4377/openapi3-standards
Appwrite #13524 and canonical specs latest #110 / 2.0.x #111 are merged. Both published documents match the reviewed SHA256
7bf999d8faec746c1fb0ead1f0539dfaa8aead401405b2b697358e7059667f98and contain nox-appwrite.produces. The branch is in sync with SDK-generator main; no parser release is required. Cloud's older server-ce pin remains unchanged; the owner explicitly approved publishing specs without waiting for that promotion.Generated SDK changes
Actual generated Rust console
account.delete_billing_address:pub async fn delete_billing_address( &self, billing_address_id: impl Into<String>, -) -> crate::error::Result<serde_json::Value> { +) -> crate::error::Result<()> {Actual generated Rust
account.deletenow sends:Actual generated Node server adds this metadata for bodyless operations:
Spec evidence: genuine CE
sitesDeleteLogafter-generation still declares only:There is no response body, and no fallback extension. Explicit response content continues to determine Accept; binary/location and OAuth return branches are unchanged. Existing Swagger2 produces remains supported through the parser's standard response content conversion.
Breaking change / release notes
Rust methods previously inferred as
Result<serde_json::Value>solely from the extension now returnResult<()>. Callers binding those results must use()and must not expect JSON from a bodyless response. Keep this breaking API correction and the JSON Accept fallback in the eventual Rust SDK release notes; the changelog template is intentionally unchanged. Apply Rust SDK breaking-change version policy at publication.Measured output
Fixed published canonical baseline (1,020 operations) has 117 bodyless operations: 49 with old extension and 68 without. Clean actual Rust generations show 11 client / 23 server / 38 console corrected signatures and 14 / 54 / 60 added Accept headers respectively. Counts depend on platform/exclusions/aliases. Other targets have only JSON Accept additions and necessary comma formatting; CLI/GraphQL output is unchanged. Rust has only approved signature/header changes, documentation signatures and strengthened integration harness.
Standard Swagger2 1.8.x server: explicit media and Rust signatures preserved; 39 JSON Accept insertions only where no produced content exists.
Validation
Existing gate limitations
usage_event_metric.rs; reproduced on baseline.npm run buildpassed all 830 tests.788f49ae7932608a5269d5049cad10f3b6bea429; fresh checks follow the changelog-only revert. An additional local Rust e2e rerun initially encountered mock-server connectivity failures; one unchanged-code environment retry passed (1 test, 131 assertions).Follow-through
Cloud pins sdk-generator
4.9.*; CE allows^4.0. After choosing and publishing the generator version, plan a targeted Cloud dependency promotion if that range excludes it. No speculative version bump here.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.
Narrow regression and full generation suite passed at
788f49ae7932608a5269d5049cad10f3b6bea429, based on SDK-generator mainf072d890699106748a9899a344a6932b31a41118. Follow-upb251f6eebremoves only the proposed changelog-template entries; Rust server was regenerated successfully. No new unit tests.