lutaml-model 0.8.148 → 0.8.149

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: a830ec6a143525a0d59b70b642ffa232553eb7aadb9d1b6a7cd740a1cfcad6cb
4
- data.tar.gz: 565167c64a78c785ff6f6742bce3ee5c56083022bd9c37746af983cace306262
3
+ metadata.gz: '05094b330515b62b69ce8a2576cdf74b7e5441358210ef20191d5e1ee6eca0fd'
4
+ data.tar.gz: 1a97398db1d90288bd121c355136e64e1d68df8d5c93dfc7a2d4812da062b538
5
5
  SHA512:
6
- metadata.gz: e26f1bec70e96e4311140e345cd7cb15e048b71fe37df05d96bbe8cf319b959bba4e6a6073ac61767e4a6c8a94c7a3e14c5decab75412718bb73cf7d7fee6e1a
7
- data.tar.gz: a2c55f36c898966db5499b0485702a50749bef098ff3f07e8e4ee90caab1d2c112294adc59da7a6dac486d256679f4f27a426b8384e35932a3228998b27e21f5
6
+ metadata.gz: ad0eb3a038d4a6f380ccae5336187ca306b253a4708163c76ec2296e82b6605200f1eb91760f6333381c78a0ee260b7013137f2ffdfce6cc9015097931eadb78
7
+ data.tar.gz: 5381dfdafa4829d1ef964d94cfdeb3c9ce4c895f2eba6fa5d84a74ee20a3ec2ae6f1ff0dbab387dd220b405f180bfa1abcc2663e7ca41d8235da96a82280752c
@@ -566,8 +566,26 @@ module Lutaml
566
566
  # defaults would otherwise count as set and a render_default:
567
567
  # false element would be written back out.
568
568
  if constructs_through_initialize?
569
- instance = new(lutaml_register: register_id)
570
- instance.init_deserialization_state(register_id)
569
+ # (#1059) Run the custom initialize against COMPILED
570
+ # constructor-equivalent state — the walk seed (defaults
571
+ # resolved, non-defaulted attributes nil), not the
572
+ # deserialization seed: constructor bodies branch on
573
+ # truthiness and is_a? checks of plain state, and an
574
+ # UninitializedClass sentinel is truthy, so seeding
575
+ # sentinels here would misfire every convenience-conversion
576
+ # branch (uniword's convert_flat_attributes! constructed
577
+ # wrapper objects per node). The generic attribute walk is
578
+ # still stood down for the run — it would only re-materialize
579
+ # the same defaults the seed already wrote — and #922's
580
+ # finalize then resets attribute state to the deserialization
581
+ # markers, so constructor-seeded defaults do not count as
582
+ # set, exactly as before.
583
+ instance = allocate
584
+ instance.init_walk_state(register_id)
585
+ instance.lutaml_constructor_seeded = true
586
+ instance.send(:initialize)
587
+ instance.lutaml_constructor_seeded = nil
588
+ instance.finalize_deserialization(register_id)
571
589
  return instance
572
590
  end
573
591
  instance = allocate
@@ -154,7 +154,26 @@ module Lutaml
154
154
 
155
155
  attr_accessor :lutaml_register, :lutaml_parent, :lutaml_root
156
156
 
157
+ # Internal deserialization state (#1059): the XML constructor path
158
+ # seeds constructor-equivalent compiled state, runs the user
159
+ # initialize, and only then resets attribute state to the
160
+ # deserialization markers (#922). While the flag is set,
161
+ # #initialize stands down — its generic attribute walk would only
162
+ # re-materialize defaults that the post-run reset discards.
163
+ attr_accessor :lutaml_constructor_seeded
164
+
157
165
  def initialize(attrs = {}, options = {})
166
+ if lutaml_constructor_seeded
167
+ # The deserialization constructor seeded constructor-equivalent
168
+ # compiled state (defaults resolved, non-defaulted nil) and
169
+ # resets attribute state after this initialize returns; the
170
+ # generic attribute walk here would only materialize defaults
171
+ # that the reset then discards (#922). This IS the custom
172
+ # initialize's super call — the body above us has already run
173
+ # against that state.
174
+ return
175
+ end
176
+
158
177
  @using_default = {}
159
178
  @lutaml_register = extract_register_id(attrs, options)
160
179
  return unless self.class.attributes(@lutaml_register)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Lutaml
4
4
  module Model
5
- VERSION = "0.8.148"
5
+ VERSION = "0.8.149"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lutaml-model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.148
4
+ version: 0.8.149
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-10-30 00:00:00.000000000 Z
11
+ date: 2026-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base64