Skip to content

fix: validate string array parameters from SDK schemas - #10

Open
HarshMN2345 wants to merge 3 commits into
mainfrom
codex/python-nested-query-serialization
Open

fix: validate string array parameters from SDK schemas#10
HarshMN2345 wants to merge 3 commits into
mainfrom
codex/python-nested-query-serialization

Conversation

@HarshMN2345

@HarshMN2345 HarshMN2345 commented Sep 11, 2026

Copy link
Copy Markdown
Member

The Console Python SDK advertises arrays of strings but currently accepts query objects and other incompatible values until request serialization fails. This causes the local concatenation crash reported in MCP-X.

Apply the schema-driven Python template change from sdk-generator#1899. Every request parameter whose schema declares an array of strings now rejects incompatible inputs before HTTP with an AppwriteException of type sdk_input_validation (code 0, no HTTP response). This covers permissions, scopes, events, and other parameter names as well as queries. Optional values, empty arrays, string-backed enum members, and nullable items retain their declared behavior. JSON syntax validation remains with the API because the schema only declares string items.

The generic serializer correction also remains: list indices are chosen before string-key concatenation, preserving support for nested raw and multipart parameters.

Generation provenance: rendered the before/after templates against the immutable Console OpenAPI snapshot at specs@19db43b, then applied only the generated validation delta: 282 calls across 36 service files and the existing base Service validator. Every affected parameter's annotation and default matches SDK 0.6.0; stripping the new calls leaves the original service ASTs unchanged. No unrelated API, response-model, or release-metadata changes are included.

Validation: all 1,058 SDK tests and Black checks for all 39 changed Python files pass. Existing TablesDB service tests cover six invalid query shapes and three invalid permission shapes, each returning the typed local error without sending HTTP. Removing the generated checks reproduces all nine failures. Unicode JSON queries, empty/omitted options, and enum/string index orders remain successful. Tests use local HTTP mocks. Downstream MCP handling and regressions are tracked in mcp#117; the SDK must be released and adopted before the production incident is resolved.

@greptile-apps

greptile-apps Bot commented Sep 11, 2026

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

The PR appears safe to merge; no actionable correctness, security, or repository-rule violations remain.

Summary

  • Invalid list containers and non-string items now raise a typed local AppwriteException before HTTP.
  • String-backed enums continue to work because validation checks their normalized wire values.
  • Generated validation is applied consistently across the affected service modules.
  • TablesDB tests cover rejected permissions and queries, optional and empty query lists, Unicode query strings, and mixed enum/string ordering values.
  • The previous implementation-coupled test finding was manually resolved, and the current tests verify public exception and HTTP-boundary behavior.

Reviews (3) 路 Last reviewed commit: "fix: validate string array parameters fr..."

Comment thread test/services/test_tables_db.py Outdated
@HarshMN2345 HarshMN2345 changed the title fix: serialize nested list parameters before API calls fix: validate string array parameters from SDK schemas Sep 11, 2026
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