grpc-rest 0.1.22 → 0.1.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4e105820176e2fb387f9ff63ae82a086de8d1b291d372f8e8ba3d38dfc34859
|
4
|
+
data.tar.gz: 1e480bc608d0524821ba06d408681830294ab34c9e36bd330b881f48128f8e33
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8118e6cbb88e44bc3577e66c4639f3e5b87ff18515f1c27d9dd5d458caacac52030f39afbd4a108b2009115b7e28ce9c9c7a810419517f700894538febfe3de
|
7
|
+
data.tar.gz: e591ab5d4d0481048f4e61814d1552d83c782f91191fd4f3f1aa430bacfc257aaac2ff3225152767b5acb7e13f1dcc75c42cb86ae93919d6b3cfc483b7bea53d
|
data/CHANGELOG
CHANGED
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
7
7
|
|
8
8
|
## UNRELEASED
|
9
9
|
|
10
|
+
# 0.1.24 - 2024-12-09
|
11
|
+
- Log error backtraces.
|
12
|
+
|
13
|
+
# 0.1.23 - 2024-11-25
|
14
|
+
- Fix: Return a 400 status code when payload is invalid JSON
|
15
|
+
|
10
16
|
# 0.1.22 - 2024-10-31
|
11
17
|
- Fix: calling `fail!` in gruf Interceptors was failing with an unrelated exception.
|
12
18
|
|
data/Gemfile.lock
CHANGED
data/lib/grpc_rest/version.rb
CHANGED
@@ -63,7 +63,7 @@ class {{.ControllerName}}Controller < ActionController::Base
|
|
63
63
|
rescue_from GRPC::BadStatus do |e|
|
64
64
|
render json: GrpcRest.error_msg(e), status: GrpcRest.grpc_http_status(e.code)
|
65
65
|
end
|
66
|
-
rescue_from Google::Protobuf::TypeError do |e|
|
66
|
+
rescue_from ActionDispatch::Http::Parameters::ParseError, Google::Protobuf::TypeError do |e|
|
67
67
|
render json: GrpcRest.error_msg(e), status: :bad_request
|
68
68
|
end
|
69
69
|
METHOD_PARAM_MAP = {
|
@@ -102,20 +102,22 @@ func ProcessService(service *descriptorpb.ServiceDescriptorProto, pkg string) (F
|
|
102
102
|
return FileResult{}, routes, err
|
103
103
|
}
|
104
104
|
restOpts, err := ExtractRestOptions(m)
|
105
|
-
if err != nil {
|
105
|
+
if err != nil {
|
106
|
+
return FileResult{}, routes, err
|
107
|
+
}
|
106
108
|
httpMethod, path, err := MethodAndPath(opts.Pattern)
|
107
109
|
pathInfo, err := ParsedPath(path)
|
108
110
|
if err != nil {
|
109
111
|
return FileResult{}, routes, err
|
110
112
|
}
|
111
113
|
controllerMethod := method{
|
112
|
-
Name:
|
113
|
-
RequestType:
|
114
|
-
Path:
|
115
|
-
RestOptions:
|
116
|
-
HttpMethod:
|
117
|
-
Body:
|
118
|
-
PathInfo:
|
114
|
+
Name: strcase.ToSnake(m.GetName()),
|
115
|
+
RequestType: Classify(m.GetInputType()),
|
116
|
+
Path: path,
|
117
|
+
RestOptions: rubyRestOptions(restOpts),
|
118
|
+
HttpMethod: httpMethod,
|
119
|
+
Body: opts.Body,
|
120
|
+
PathInfo: pathInfo,
|
119
121
|
}
|
120
122
|
data.Methods = append(data.Methods, controllerMethod)
|
121
123
|
routes = append(routes, Route{
|
@@ -11,9 +11,10 @@ class MyServiceController < ActionController::Base
|
|
11
11
|
rescue_from GRPC::BadStatus do |e|
|
12
12
|
render json: GrpcRest.error_msg(e), status: GrpcRest.grpc_http_status(e.code)
|
13
13
|
end
|
14
|
-
rescue_from Google::Protobuf::TypeError do |e|
|
14
|
+
rescue_from ActionDispatch::Http::Parameters::ParseError, Google::Protobuf::TypeError do |e|
|
15
15
|
render json: GrpcRest.error_msg(e), status: :bad_request
|
16
16
|
end
|
17
|
+
|
17
18
|
METHOD_PARAM_MAP = {
|
18
19
|
|
19
20
|
"test" => [
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grpc-rest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.24
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Orner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: grpc
|