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: 47964383a0aa5a5835edd72fae78e2febe1364fdd13f598a588dc3702f5f882b
4
- data.tar.gz: 14255db74de1d544d8964f3bb3b2e5515f6a25d50ab54bd0e00e6eb550ec9309
3
+ metadata.gz: b4e105820176e2fb387f9ff63ae82a086de8d1b291d372f8e8ba3d38dfc34859
4
+ data.tar.gz: 1e480bc608d0524821ba06d408681830294ab34c9e36bd330b881f48128f8e33
5
5
  SHA512:
6
- metadata.gz: 8d85e2f3169ec0dedff6f49e193ac1208caeee918c54b99ab3ee18f05973defad99edb8587fab5fe89cdbfb89d44278eda50f329e00e1bb304722ef10ef7c693
7
- data.tar.gz: 7ab65c78dc7aadac67a325705d28a3b79873ce24562fa02f1e4f71500536612d49c58806259ed8340b65bd53b3f2f64bf9946b597751d4ff67ae29b086856d63
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- grpc-rest (0.1.21)
4
+ grpc-rest (0.1.22)
5
5
  grpc
6
6
  rails (>= 6.0)
7
7
 
@@ -1,3 +1,3 @@
1
1
  module GrpcRest
2
- VERSION = '0.1.22'
2
+ VERSION = '0.1.24'
3
3
  end
@@ -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 { return FileResult{}, routes, err }
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: strcase.ToSnake(m.GetName()),
113
- RequestType: Classify(m.GetInputType()),
114
- Path: path,
115
- RestOptions: rubyRestOptions(restOpts),
116
- HttpMethod: httpMethod,
117
- Body: opts.Body,
118
- PathInfo: 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.22
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-10-31 00:00:00.000000000 Z
11
+ date: 2024-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: grpc