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 +4 -4
- data/README.md +7 -6
- data/lib/swagger/serializer/version.rb +1 -1
- data/lib/swagger/serializer.rb +4 -0
- data/swagger-serializer.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bda748bb32d9308010609db0d3e86aa515ec85207d8ebba302f90e897139e500
|
4
|
+
data.tar.gz: a32eea14539ec58fcdbf3f9ef491ffc844a18247bf3c812e6e43a0be3e772f3a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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.
|
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
|
data/lib/swagger/serializer.rb
CHANGED
data/swagger-serializer.gemspec
CHANGED
@@ -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", "~>
|
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.
|
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:
|
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: '
|
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: '
|
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.
|
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:
|