[AND-433] Add default values to the collection properties generated by Open API - #1353
Closed
rahul-lohra wants to merge 17 commits into
Closed
rahul-lohra wants to merge 17 commits into
rahul-lohra wants to merge 17 commits into
Conversation
Contributor
SDK Size Comparison 📏
|
rahul-lohra
marked this pull request as draft
April 9, 2025 08:14
…re/rahullohra/add_default_values
rahul-lohra
marked this pull request as ready for review
April 9, 2025 18:30
| currentProject { | ||
| instrumentation { | ||
| excludedClasses.addAll( | ||
| "io.getstream.android.video.generated.models.*", |
Member
There was a problem hiding this comment.
Won't the next line cover this path as well?
Contributor
Author
There was a problem hiding this comment.
Yes you are right, I will remove this line.
|
rahul-lohra
marked this pull request as draft
July 10, 2025 08:29
|
Contributor
Author
|
Closed. Will pick this up later |
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.



🎯 Goal
[AND-433] Add default values to the collection properties generated by Open API
OpenAPI generated models have fields which are mandatory, but sometimes don't arrive from the backend.
e.g. custom field in
OwnUserResponse.The signature of the field is
val custom: Map<String, Any?>We should generate these fields with a default value of empty map to prevent the parsers from failing if the field is missing. We already use relaxed parsing on the Moshi parsers, however they cannot handle everything.
The best approach for us is to generate the models to include default values for collections:
e.g.
val custom: Map<String, Any?> = emptyMap()For optional fields the handling should remain the same.
We are also adding default values to the properties which are mentioned in the Open API like
Previous
Now