swagger-serializer 0.7.0 → 0.8.0

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: c981a97501496cce000677d6bb67c02db75b948d00541c683ef56c0fcf738d47
4
- data.tar.gz: 1f53440f04121534346790081311a9e8907ffce11c8244c9bc8ca5dc4c405889
3
+ metadata.gz: 2db06e0ef0a3003dd60b7bb191206b5d40f1b8a07065356745afe7b04bd2a0f8
4
+ data.tar.gz: 7513789b00e3bf672e20fe163bda359009f4419fac0ca1bbf9a84b50e7b77ecb
5
5
  SHA512:
6
- metadata.gz: 2da0855070adbcaf65cd2e52569bff14fdb30b106af975acbcfbf33c18cd61a37a4e0b934580599c8479dda4de3e0b0c8baf67cd6aef786608ced9991821a9b7
7
- data.tar.gz: 56a07032f129c2fa4d624347fd4ce60adff1ff0397afaaeb53a8c04b84afa39fa275b8391d5e13e70e7c49e148f0e4f9becf0621f41a560d9904f2e4979c2806
6
+ metadata.gz: 7096a0b8bbfcbbe48036c85f3c5948eb60405ecc001e9b17e8183d15f06dd5b605ccd0169851965c1b36da76cabc7dbd18661924af67b735162ca8296ef08c11
7
+ data.tar.gz: d8a12cde3ab7977c463ab0ac4989015fcdac90f10f87d0e9733dddcbf27a745236501e9d348b9bc515c710bafbe4e966cf957ef10b91062b219cc62c40752b47
@@ -37,6 +37,8 @@ module Swagger
37
37
  end
38
38
 
39
39
  def component(name)
40
+ # HogeSerializer
41
+ name = name.name.sub(/Serializer$/, "") if name.class == Class
40
42
  component = Util.try_hash(components, name)
41
43
  Component.new(component) if component
42
44
  end
@@ -9,8 +9,9 @@ module Swagger
9
9
  @schema = schema
10
10
  end
11
11
 
12
- def serializer(options = {})
13
- JSON::Schema::Serializer.new(@schema, options)
12
+ def serializer(options = {}, store = true)
13
+ use_options = store ? Swagger::Serializer::Store.current.serialize_options.merge(options) : options
14
+ JSON::Schema::Serializer.new(@schema, use_options)
14
15
  end
15
16
  end
16
17
  end
@@ -14,12 +14,14 @@ module Swagger
14
14
 
15
15
  define_schema_accessor :schema, :example, :examples, :encoding
16
16
 
17
- def serializer(options = {})
18
- JSON::Schema::Serializer.new(schema, options)
17
+ def serializer(options = {}, store = true)
18
+ use_options = store ? Swagger::Serializer::Store.current.serialize_options.merge(options) : options
19
+ JSON::Schema::Serializer.new(schema, use_options)
19
20
  end
20
21
 
21
- def deserializer(options = {})
22
- Deserializer.new(schema, options)
22
+ def deserializer(options = {}, store = true)
23
+ use_options = store ? Swagger::Serializer::Store.current.deserialize_options.merge(options) : options
24
+ Deserializer.new(schema, use_options)
23
25
  end
24
26
 
25
27
  def validator
@@ -57,12 +57,14 @@ module Swagger
57
57
  schema
58
58
  end
59
59
 
60
- def serializer(options = {})
61
- JSON::Schema::Serializer.new(to_json_schema, options)
60
+ def serializer(options = {}, store = true)
61
+ use_options = store ? Swagger::Serializer::Store.current.serialize_options.merge(options) : options
62
+ JSON::Schema::Serializer.new(to_json_schema, use_options)
62
63
  end
63
64
 
64
- def deserializer(options = {})
65
- Deserializer.new(self, options)
65
+ def deserializer(options = {}, store = true)
66
+ use_options = store ? Swagger::Serializer::Store.current.deserialize_options.merge(options) : options
67
+ Deserializer.new(self, use_options)
66
68
  end
67
69
 
68
70
  def validator
@@ -1,5 +1,5 @@
1
1
  module Swagger
2
2
  module Serializer
3
- VERSION = "0.7.0".freeze
3
+ VERSION = "0.8.0".freeze
4
4
  end
5
5
  end
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.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Narazaka
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-10 00:00:00.000000000 Z
11
+ date: 2020-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json-schema-serializer
@@ -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.7.0
237
+ documentation_uri: https://www.rubydoc.info/gems/swagger-serializer/0.8.0
238
238
  post_install_message:
239
239
  rdoc_options: []
240
240
  require_paths: