Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

putQueryParam should handle special serializable types #1783

Closed
diegomarquezp opened this issue Aug 30, 2022 · 1 comment · Fixed by #1784
Closed

putQueryParam should handle special serializable types #1783

diegomarquezp opened this issue Aug 30, 2022 · 1 comment · Fixed by #1784
Assignees
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@diegomarquezp
Copy link
Contributor

diegomarquezp commented Aug 30, 2022

putQueryParam should handle object types that are serializable, such as FieldMask, by using proper serialization rather than String.valueOf() which would produce an unprocessable url format (i.e. toJson()).

A valid query param can be a primitive OR an instance of Duration, Timestamp, FieldMask or *Value wrapper classes (like Int32Value). Specific details of serialization for each type are in the protobuf language guide

@diegomarquezp diegomarquezp added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p2 Moderately-important priority. Fix may not be included in next release. labels Aug 30, 2022
@diegomarquezp diegomarquezp self-assigned this Aug 30, 2022
@blakeli0
Copy link
Contributor

The original issue was reported in googleapis/sdk-platform-java#1016 (comment)

diegomarquezp added a commit that referenced this issue Aug 31, 2022
Fixes #1783
Some message derived types such as Duration, FieldMask or Int32Value
would not be correctly handled by String.valueOf(). Instead, the
toJson() method is used to make it compliant with the protobuf languague
guide
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants