Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime: add support for time types in query parameters #693

Merged

Conversation

johanbrandhorst
Copy link
Collaborator

Adds support for parsing the google.protobuf.Duration as well as native *time.Time and *time.Duration types in url query parameters.

Helps #400. Fixes gogo/protobuf#420.

Adds support for parsing the google.protobuf.Duration as
well as native *time.Time and *time.Duration types in
url query parameters.

Helps grpc-ecosystem#400.
}
*t = d
return nil
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This part may be controversial, but I think considering this does not add any explicit dependencies on any gogoproto packages, I argue that this should be acceptable.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you elaborate? What could be considered controversial?

t.Errorf("runtime.PopulateQueryParameters(msg, %v, utilities.NewDoubleArray(nil)) = %v; want %v", spec.values, got, want)
}
}
}
Copy link
Collaborator Author

@johanbrandhorst johanbrandhorst Jul 3, 2018

Choose a reason for hiding this comment

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

This needs to be a separate test because golang/protobuf/proto.Clone panics when using *time.Time in the proto message.

@codecov-io
Copy link

Codecov Report

Merging #693 into master will increase coverage by 0.05%.
The diff coverage is 60.71%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #693      +/-   ##
==========================================
+ Coverage   56.47%   56.53%   +0.05%     
==========================================
  Files          30       30              
  Lines        3005     3032      +27     
==========================================
+ Hits         1697     1714      +17     
- Misses       1145     1151       +6     
- Partials      163      167       +4
Impacted Files Coverage Δ
runtime/query.go 71.08% <60.71%> (-0.99%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 39a18c6...11fd93f. Read the comment docs.

@johanbrandhorst
Copy link
Collaborator Author

@achew22 @tmc any objections to this?

Copy link
Collaborator

@tmc tmc left a comment

Choose a reason for hiding this comment

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

LGTM

@tmc tmc merged commit 5948c50 into grpc-ecosystem:master Jul 5, 2018
@johanbrandhorst johanbrandhorst deleted the add-duration-query-parameter branch July 6, 2018 11:18
adasari pushed a commit to adasari/grpc-gateway that referenced this pull request Apr 9, 2020
…em#693)

Adds support for parsing the google.protobuf.Duration as
well as native *time.Time and *time.Duration types in
url query parameters.

Helps grpc-ecosystem#400.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants