Skip to content

Conversation

@zaquestion
Copy link
Member

Useful for passing dates in the query

@zaquestion
Copy link
Member Author

Honestly I think a lot of this json unmarshaling in the query stuff is going to be up for the chopping block in v1

@zaquestion
Copy link
Member Author

This need to wait for

singlePBTypeUnmarshalTmpl := `
var {{.LocalName}} *{{.GoType}}
{{.LocalName}} = &{{.GoType}}{}
err = jsonpb.UnmarshalString({{.LocalName}}Str, {{.LocalName}})`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of creating thses tailored decode functions for each individual field, how about we we first merge all the variables from path, query, and body into a single JSON string, then call jsonpb.Unmarshal(s, req) to decode into the request struct in one go? Seems like it would simplify the decode logic significantly?

@toctan
Copy link
Contributor

toctan commented Nov 6, 2020

This is great! We need this to use the FieldMask update_mask field in the standard update method: https://cloud.google.com/apis/design/standard_methods#update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants