Skip to content

Infer SDK method types from OpenAPI - #1871

Merged
ChiragAgg5k merged 7 commits into
mainfrom
feat/infer-openapi-method-types
Sep 4, 2026
Merged

ChiragAgg5k merged 7 commits into
mainfrom
feat/infer-openapi-method-types

Conversation

@ChiragAgg5k

@ChiragAgg5k ChiragAgg5k commented Sep 4, 2026 •

Copy link
Copy Markdown
Member

Summary

  • infer all SDK-specific method types from standard OpenAPI operation fields
  • centralize method-type resolution in the base language implementation
  • replace direct x-appwrite.type reads across language and CLI code
  • remove x-appwrite.type completely from the e2e specification fixture
  • remove the legacy x-appwrite.type fallback so method behavior is determined exclusively from standard OpenAPI fields

Inference

  • upload: multipart request containing a binary string property
  • location: successful response containing a binary string schema
  • webAuth: redirect response containing a binary string schema
  • graphql: operation tagged graphql

Validation

  • composer lint
  • composer refactor:check
  • composer lint-twig
  • regenerated PHP, Web, Node, Ruby, Python, Dart, Flutter, React Native, Go, Swift, Apple, .NET, Android, Kotlin, Rust, and CLI SDKs
  • confirmed the extension-backed and inferred e2e specifications generate identical trees for all targets above
  • removed every type extension from generated Appwrite client, server, and console specs and confirmed output parity for Web, Node, Go, and CLI
  • confirmed inferred method counts against the production specifications for upload, location, webAuth, and GraphQL operations
  • verified generated Go/CLI with gofmt and generated Rust with rustfmt 1.83.0

This enables a follow-up Appwrite PR to remove x-appwrite.type from generated specifications entirely.

Related to CLO-4377.

@greptile-apps

greptile-apps Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

Centralizes SDK method-type inference in the base language adapter and derives upload, GraphQL, location, and web-auth behavior from standard OpenAPI structures instead of x-appwrite.type.

  • Updates target-language return-type handling and shared generator filters to use inferred method types.
  • Adds extension-free GraphQL and web-auth fixture coverage.
  • Updates utopia-php/openapi to support schema resolution during inference.

Confidence Score: 5/5

The PR appears safe to merge because no outstanding defects or repository-rule violations remain.

The referenced-schema issue is fixed by resolving schemas before binary checks, and extension-free GraphQL coverage is now present. ChiragAgg5k intentionally dismissed the legacy-extension compatibility concern because standard OpenAPI structure is now the exclusive supported contract and verified supported specifications retain output parity. No changes were made after the previous review.

Important Files Changed

Filename Overview
src/SDK/Language.php Centralizes structural method-type inference and resolves referenced request and response schemas.
src/SDK/SDK.php Routes template filters, exclusions, capability checks, and GraphQL headers through centralized inference.
src/SDK/Language/Concern/CliCommandSurface.php Uses inferred GraphQL classification for CLI query handling and descriptions.
tests/resources/spec-openapi3.json Removes legacy type extensions and adds structural web-auth and GraphQL fixture coverage.
composer.lock Updates the OpenAPI parser dependency from 0.2.0 to 0.2.1.

Reviews (9): Last reviewed commit: "refactor: remove legacy method type fall..." | Re-trigger Greptile

Comment thread src/SDK/Language.php Resolved
Comment thread src/SDK/Language.php Resolved
@ChiragAgg5k

Copy link
Copy Markdown
Member Author

@greptile review

Comment thread src/SDK/Language.php Resolved
@ChiragAgg5k

Copy link
Copy Markdown
Member Author

@greptile review

1 similar comment
@ChiragAgg5k

Copy link
Copy Markdown
Member Author

@greptile review

@ChiragAgg5k
ChiragAgg5k merged commit 0e5da66 into main Sep 4, 2026
58 checks passed
@ChiragAgg5k
ChiragAgg5k deleted the feat/infer-openapi-method-types branch September 4, 2026 17:30
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.

1 participant