Repository navigation
fix: omit unset optional string examples across SDK languages - #2140
Merged
Merged
Conversation
🟢 Tier S · Ready to mergeThe generator omits optional string examples that have no usable value across SDK documentation, using each language’s native unset representation while preserving explicit falsy values and required parameters. The change covers language-specific example generation, REST and GraphQL output, and shared regression fixtures for nested models, multipart requests, and empty JSON bodies. Latest changes: The newest commit adds a required nested Python string without an example to the fixture and asserts that it remains in generated request-model examples.
📂 Walkthrough · 19
✅ Fixed since the last review · 1
Reviewed the commits since |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Generated examples send empty strings for optional string parameters without usable examples. A permissions-only file update consequently submits an empty filename and fails server validation.
The generators now leave these values unset using each SDK’s syntax:
undefinedin Web/Node/React Native;Nonein Python;nilin Ruby/Swift/Apple;nullin Kotlin/Android/Java, Dart/Flutter, PHP and .NET/Unity. Go omits the functional option, Rust usesNone, and REST/GraphQL omit the field or argument. CLI already omits optional flags and is covered by the regression.Strict example checks also preserve the explicit string
"0", numeric zero andfalse. Required parameters, enum suggestions, explicit nonempty examples and SDK method signatures retain their behavior.Validation:
{}.Found while preparing appwrite/sdk-for-android#146, which will consume the generator patch before Android
31.0.1is published.Related: appwrite-labs/cloud#6667