json_model_rb 0.1.29 → 0.1.30

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: 251b650870de42cc2dc1baca01bde00d26da06b8f54d42ba60dd242de9d73e05
4
- data.tar.gz: d6da242849c8d707b226562000491100f64cdaf9b67cb5db936a3f1d28364628
3
+ metadata.gz: 9facb46868e12faddc75d814c5b49e54a983636ca7c65f3ceca241f4ea231f0e
4
+ data.tar.gz: cdcd040a95b264ad53607731f2770b7d4faa766a0dea35862daec30b9537eb94
5
5
  SHA512:
6
- metadata.gz: 834a856b751f6743718abf8b356cf810fed897f8e9fce4e7e1b2139357ac6d9fae632cc0e9bc575431b28d7a55011eaa22f5c92772bc2dc347381e545992c72b
7
- data.tar.gz: 07bddbffa584c59a3983874fd8ecb4e854c1f52cd0f6ddad494d54f3257e82335ffa5e913d529da9313c251649850fbae74834461325d18be3a6961abf253937
6
+ metadata.gz: 268ed430e6ba338ca54c9d185cad052750402f75e809d3a8585ca41616198463011ef755e41c1d997d12d9c39f8b053f99c5af4a7268b7ec0c5d7204d33a9828
7
+ data.tar.gz: bc5ae606f19b2dda83f34e4028c3e576ec568f2adcbfeb697598a7b88b9a3a8857fb629379b2a95294d7743ca4a1fa831fe9986d9539fc2adf0d21049bda6a5f
@@ -13,6 +13,7 @@ module JsonModel
13
13
  # @param [FalseClass, TrueClass] safe
14
14
  # @param [Proc] block
15
15
  # @return [::Object, nil]
16
+ # rubocop:disable Style/OptionalBooleanParameter
16
17
  def new(attributes = default_attributes, safe = false, &block)
17
18
  super(
18
19
  attributes.transform_keys { |key| invert_alias(key) },
@@ -20,6 +21,7 @@ module JsonModel
20
21
  &block
21
22
  )
22
23
  end
24
+ # rubocop:enable Style/OptionalBooleanParameter
23
25
 
24
26
  # @param [Symbol] key
25
27
  # @return [Symbol]
@@ -18,6 +18,7 @@ module JsonModel
18
18
  super
19
19
  subclass.meta_attributes.merge!(meta_attributes.dup)
20
20
  subclass.meta_attributes[:$ref] = schema_id
21
+ subclass.schema_id(JsonModel.config.schema_id_naming_strategy.call(subclass))
21
22
  end
22
23
 
23
24
  schema_id(JsonModel.config.schema_id_naming_strategy.call(self))
@@ -67,7 +68,7 @@ module JsonModel
67
68
 
68
69
  # @return [Hash]
69
70
  def meta_attributes
70
- @meta_attributes ||= {}
71
+ @meta_attributes ||= {}
71
72
  @meta_attributes.merge!({ unevaluatedProperties: @schema&.strict? ? false : nil }.compact)
72
73
  end
73
74
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JsonModel
4
- VERSION = '0.1.29'
4
+ VERSION = '0.1.30'
5
5
  end
@@ -75,10 +75,10 @@ RSpec.describe('File system schema') do
75
75
  attribute(
76
76
  :storage,
77
77
  JsonModel::Types.one_of(:type) do
78
+ on('disk', DiskDevice.local)
78
79
  on('diskUUID', 'diskuuid', DiskUuid.local)
79
80
  on('nfs', Nfs.local)
80
81
  on('tmpfs', Tmpfs.local)
81
- on('disk', DiskDevice.local)
82
82
  end,
83
83
  )
84
84
  attribute(:fstype, JsonModel::Types::String.enum('ext3', 'ext4', 'btrfs'))
@@ -205,4 +205,4 @@ RSpec.describe('File system schema') do
205
205
  expect(instance.options).to(eq(%w(rw noatime)))
206
206
  expect(instance.readonly).to(be_nil)
207
207
  end
208
- end
208
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json_model_rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.29
4
+ version: 0.1.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Gillesberger
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2026-02-06 00:00:00.000000000 Z
10
+ date: 2026-03-06 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: rake