json-schema-serializer 1.5.1 → 1.5.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: 37e694cb4884a1ca5064e0d0ec1ec8e8c71b4033f802c60eda6c409cbc47eae2
4
- data.tar.gz: abbc2a9dae69d938498280fcd70b27ee2b0d4d575271112b3196b9655b1a0686
3
+ metadata.gz: d6ac2c2fbbc49625b87c22bba8061ef8aacff924a4e1bfa19faedbeeb3d6fcb7
4
+ data.tar.gz: 4071e3b87030dc4bff3f5800a650618619b703121094afea5b9cae8b1f584689
5
5
  SHA512:
6
- metadata.gz: 20ccc5691d1928f7869be012a310096f4e8c1ae0a879a954126cd1c478e7596a2d7f523e22f1efba91e8c2735bea6c32960da6db9d0c2b973f49feec6d8e6c5f
7
- data.tar.gz: b9c86efa2961c16b00c9ba072277e7d98e12a8c6f6d4e86dbef6c366785bdcd054c35766a227586907e4e5ea3a05eb5a2fdcd59265dfa15b89ad629fea1e580e
6
+ metadata.gz: c5372d62cecbea2832b93c09b4c3c7336a54d52e342f23d7c8689266d2b848d94ffb218cb19464ba16d74464da6ccc69c4706127f85acfa383f24cbb209d9cf0
7
+ data.tar.gz: 5426726b5f922839c4e21b0172a1f9281167bc2c5f41ef18baa81995d2395949624627f6b786f2c764715fabef7ba299f21d316a40d4b456543755b9b68eb3e3
data/README.md CHANGED
@@ -185,7 +185,7 @@ options
185
185
 
186
186
  schema object `$ref` resolver
187
187
 
188
- #### options[:input_key_transform] [Proc]
188
+ #### options[:schema_key_transform_for_input] [Proc]
189
189
 
190
190
  input key transform
191
191
 
@@ -195,10 +195,10 @@ new({
195
195
  properties: {
196
196
  userCount: { type: :integer },
197
197
  },
198
- }, { input_key_transform: ->(name) { name.underscore } }).serialize({ user_count: 1 }) == { "userCount" => 1 }
198
+ }, { schema_key_transform_for_input: ->(name) { name.underscore } }).serialize({ user_count: 1 }) == { "userCount" => 1 }
199
199
  ```
200
200
 
201
- #### options[:output_key_transform] [Proc]
201
+ #### options[:schema_key_transform_for_output] [Proc]
202
202
 
203
203
  output key transform
204
204
 
@@ -208,7 +208,7 @@ new({
208
208
  properties: {
209
209
  userCount: { type: :integer },
210
210
  },
211
- }, { output_key_transform: ->(name) { name.underscore } }).serialize({ userCount: 1 }) == { "user_count" => 1 }
211
+ }, { schema_key_transform_for_output: ->(name) { name.underscore } }).serialize({ userCount: 1 }) == { "user_count" => 1 }
212
212
  ```
213
213
 
214
214
  #### options[:injectors] [Hashlike<String, Class>, Class], options[:inject_key] [String, Symbol]
@@ -189,8 +189,8 @@ module JSON
189
189
  properties_schema = try_hash(schema, :properties)
190
190
  additional_properties_schema = try_hash(schema, :additionalProperties)
191
191
  required_schema = Set.new(try_hash(schema, :required)&.map(&:to_s))
192
- input_key_transform = options[:input_key_transform] # schema key -> input obj key
193
- output_key_transform = options[:output_key_transform] # schema key -> out
192
+ input_key_transform = options[:schema_key_transform_for_input] # schema key -> input obj key
193
+ output_key_transform = options[:schema_key_transform_for_output] # schema key -> out
194
194
  ret =
195
195
  properties_schema.map do |name, property_schema|
196
196
  input_key = input_key_transform ? input_key_transform.call(name.to_s) : name
@@ -1,7 +1,7 @@
1
1
  module JSON
2
2
  class Schema
3
3
  class Serializer
4
- VERSION = "1.5.1".freeze
4
+ VERSION = "1.5.2".freeze
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json-schema-serializer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Narazaka
@@ -181,7 +181,7 @@ metadata:
181
181
  homepage_uri: https://github.com/Narazaka/json-schema-serializer
182
182
  source_code_uri: https://github.com/Narazaka/json-schema-serializer.git
183
183
  changelog_uri: https://github.com/Narazaka/json-schema-serializer/blob/master/CHANGELOG.md
184
- documentation_uri: https://www.rubydoc.info/gems/json-schema-serializer/1.5.1
184
+ documentation_uri: https://www.rubydoc.info/gems/json-schema-serializer/1.5.2
185
185
  post_install_message:
186
186
  rdoc_options: []
187
187
  require_paths: