fix: message parameters in querystring #430
Merged
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.
This PR addresses two issues happening in our REST query string serialization
Ensures when
additionalBindings
contains a message with nested fields, the fields are added to the querystring using dot syntax (e.g.interval.startTime
)Example: in Monitoring V3, we require the interval query string parameter, but this is of type
TimeInterval
, and should actually end up beinginterval.startTime
andinterval.endTime
(see the API documentation)Ensures certain protobuf types are serialized to JSON correctly according to https://developers.google.com/protocol-buffers/docs/proto3#json
Example: the values for
startTime
andendTime
in the example above should be a formatted date string derived from theGoogle\Protobuf\Timestamp
message.Other things worth mentioning
additionalBindings
descriptors (e.g.listTimeSeries
). The error being thrown isObject of class Google\Cloud\Monitoring\V3\TimeInterval could not be converted to string