Repository navigation
fix(specs): emit array schemas for custom array validators - #14265
Conversation
A validator outside the known list fell through to a string schema even when getType() said array, so cloud's WAF Conditions param was typed as a string and every SDK sent conditions in the wrong JSON shape.
|
Review complete. No issues found — approved ✅. This PR improves OpenAPI3 spec generation: array-typed validators previously emitted
Reviewed commit: f7aeae5 |
🟢 Tier S · Ready to merge
The OpenAPI generator now emits array schemas for custom validators whose type is
📂 Walkthrough · 2
Reviewed |
Security rulesNo new WARNING or ERROR findings from security rules. 32 existing findings tracked in
|
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
Both check a whole array, so #14265 emitted them as arrays with untyped items and the SDKs typed WAF conditions and OAuth2 resource indicators as untyped values. Conditions always holds condition strings; an array-typed Multiple is only used for the resource indicator list, so both get string items in OpenAPI and GraphQL.
A param validator outside the spec generator's known list fell through to
type: string, even when itsgetType()isarray. The WAFConditionsvalidator is one of these, so every WAF create/update rule endpoint declaredconditionsas a string. The generated SDKs then sent a single string where the API expects an array (flagged on appwrite/sdk-for-go#83).Such a validator now emits
type: array. Itsitemsschema is{}because the validator declares no item type. That matches howArrayListof a mixed validator is emitted, and WAF conditions do accept both condition strings and condition objects.testCustomArrayValidatorsEmitArraySchemasfails without the change.Related: appwrite-labs/cloud#6413