swagger-serializer 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: da9cac70a15262e0347ae5505044169f3e9a6f80aec1f604d8f7ff7bf431cc94
4
- data.tar.gz: c6e8270890b50456e51a27423a9c55fca437e60363fe43ad3b14ae4adae377cc
3
+ metadata.gz: bda748bb32d9308010609db0d3e86aa515ec85207d8ebba302f90e897139e500
4
+ data.tar.gz: a32eea14539ec58fcdbf3f9ef491ffc844a18247bf3c812e6e43a0be3e772f3a
5
5
  SHA512:
6
- metadata.gz: 5aab9030106681ed9f9807d04d15d79d0353bbc3d8655304db2f433b56623db466e8ac74e1bc8efcdfcafd2edae374d701631153c67f995dca0317905d50ff0b
7
- data.tar.gz: 6579c2a177c3b8790de0672119d69514397f755a37488078017baa5f8ac02f2090c455f1cb972c88aeac4ba5598b8b808f74d6643029ddab644e8082ed58dee5
6
+ metadata.gz: e8b3dd2abbbaed3fc208dc38fb5c92033eadce081a6ee031a759654c6ae6711b06d57c5ddab36251d5210e1e21052024b0802fb7a662bfbd25a09b2484626a2a
7
+ data.tar.gz: 4d313ee5fb65c7de7510f7e6e16143d41deff79e93d7411e78c52acc5d3afe72f30b9bb2c547f273849af3fe3ca8446bfbafb0f134bff60d58c39fa251440fb3
data/README.md CHANGED
@@ -33,12 +33,16 @@ Load it in initializer.
33
33
  # config/initializers/swagger_serializer.rb
34
34
 
35
35
  if Rails.application.config.eager_load
36
+ Swagger::DSL.current.config.lazy_define_paths = true
36
37
  Rails.application.config.after_initialize do
38
+ Rails.application.reload_routes!
39
+ Swagger::DSL.current.define_paths!
37
40
  Swagger::Schema.current = Swagger::Schema.new(Swagger::DSL.current.resolved)
38
41
  end
39
42
  else
40
43
  Swagger::Schema.current = Swagger::Schema.new(Swagger::DSL.current)
41
- Swagger::Serializer::Store.current.options[:resolver] = Swagger::DSL.current.resolver
44
+ Swagger::Serializer::Store.current.serialize_options[:resolver] = Swagger::DSL.current.resolver
45
+ Swagger::Serializer::Store.current.deserialize_options[:resolver] = Swagger::DSL.current.resolver
42
46
  end
43
47
  ```
44
48
 
@@ -186,7 +190,8 @@ The key is configurable by
186
190
 
187
191
  ```ruby
188
192
  # in config/initializers/swagger_serializer.rb
189
- Swagger::Serializer::Store.current.options[:inject_key] = "my_inject_key"
193
+ Swagger::Serializer::Store.current.serialize_options[:inject_key] = "my_inject_key"
194
+ Swagger::Serializer::Store.current.deserialize_options[:inject_key] = "my_inject_key"
190
195
  Swagger::DSL.current.config.inject_key = "my_inject_key"
191
196
  ```
192
197
 
@@ -299,10 +304,6 @@ end
299
304
 
300
305
  Now you can get `{ "id" => 42, "name" => "me!!!!" }`.
301
306
 
302
- This serializer class detection uses the schema's `title` key.
303
- If you want to use `Foo::BarSerializer`, set `Foo::Bar` to `title` key.
304
- The key is configurable by `Swagger::Serializer::Store.current.options[:inject_key] = "my_inject_key"`.
305
-
306
307
  Sometimes model needs direct serialize.
307
308
 
308
309
  ```ruby
@@ -1,5 +1,5 @@
1
1
  module Swagger
2
2
  module Serializer
3
- VERSION = "0.6.1".freeze
3
+ VERSION = "0.6.2".freeze
4
4
  end
5
5
  end
@@ -24,5 +24,9 @@ module Swagger
24
24
  def method_missing(name, *args)
25
25
  @model.public_send(name, *args)
26
26
  end
27
+
28
+ def nil?
29
+ @model.nil?
30
+ end
27
31
  end
28
32
  end
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
30
30
  spec.add_dependency "json-schema-serializer", "~> 1.4"
31
31
  spec.add_dependency "snake_camel", "~> 1.1"
32
32
  spec.add_development_dependency "bundler", "~> 2"
33
- spec.add_development_dependency "rake", "~> 10.5"
33
+ spec.add_development_dependency "rake", "~> 13.0"
34
34
  spec.add_development_dependency "rspec", "~> 3.9"
35
35
  spec.add_development_dependency "rspec-power_assert", "~> 1.1"
36
36
  spec.add_development_dependency "rubocop", "~> 0.76"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: swagger-serializer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Narazaka
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-12-03 00:00:00.000000000 Z
11
+ date: 2020-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json-schema-serializer
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '10.5'
61
+ version: '13.0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '10.5'
68
+ version: '13.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -234,7 +234,7 @@ metadata:
234
234
  homepage_uri: https://github.com/Narazaka/swagger-serializer
235
235
  source_code_uri: https://github.com/Narazaka/swagger-serializer.git
236
236
  changelog_uri: https://github.com/Narazaka/swagger-serializer/blob/master/CHANGELOG.md
237
- documentation_uri: https://www.rubydoc.info/gems/swagger-serializer/0.6.1
237
+ documentation_uri: https://www.rubydoc.info/gems/swagger-serializer/0.6.2
238
238
  post_install_message:
239
239
  rdoc_options: []
240
240
  require_paths: