lutaml-model 0.8.104 → 0.8.105

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: bd4d3ab0b184df92ad1d6ef04af5e1e1af9d483d34902f36d94b010477c54841
4
- data.tar.gz: 6e5eee3bebcf1b9557b1cf635253b322a5dffc31fcbe1c7e3b07a76143a2100f
3
+ metadata.gz: c9d133a4a89e51d9a1ed811bd992faeac4f0a8513e283b46f079707bcc083f7e
4
+ data.tar.gz: e4df7bb98a1f7518bdd9f2194934e91feea5367bbf536f75aa4353a067b65049
5
5
  SHA512:
6
- metadata.gz: 761158fee8d42f919236179a76b90116183afde1cc7e8beb6921c958c27d03c96a6ada9a04abc0959417e34f1ca7677e99b33c00ef38326fe10cf196c0010e4f
7
- data.tar.gz: 96f3e592216d1f0fe4bc6274ea92006e8db8fb67d77b31dbe79868175d1a42cfa17145ea9ac981d2ba6aaecf9cf9888260a1a33675f6aa7b735667d275270e23
6
+ metadata.gz: 7040ad58b0a31222207e14245293f8f20eb674180dcd55936de938151f16fc5260615f5ec3244769e4644af0bd6f02c9262e87717cbdff9d578a6b1365bbbb3a
7
+ data.tar.gz: f5d38407f6e5ad1b87bad426f68398a6e1249b57c928aa1a94f0585b144517542f0565c38ad2f53b31bc2c80bdaf63a5425968ba883c9d222508940f9b8b1c17
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Lutaml
4
4
  module Model
5
- VERSION = "0.8.104"
5
+ VERSION = "0.8.105"
6
6
  end
7
7
  end
@@ -20,7 +20,6 @@ module Lutaml
20
20
  raw_xml = xml
21
21
  xml = normalize_xml_for_parse(xml)
22
22
  parsed = parse_with_moxml(xml, parse_encoding)
23
- assert_no_truncated_recovered_parse!(parsed)
24
23
  root_element = parsed.root
25
24
 
26
25
  raise_empty_document_error(parsed.parse_errors) if root_element.nil?
@@ -31,31 +30,6 @@ module Lutaml
31
30
  new(root, parse_encoding, **parse_document_options(raw_xml))
32
31
  end
33
32
 
34
- # Recover-mode parsing must never masquerade input truncation as
35
- # success.
36
- #
37
- # moxml releases before 0.5.84 parsed Nokogiri documents without
38
- # XML_PARSE_HUGE, so libxml2 capped its input buffer at 10 MB;
39
- # longer documents tripped a fatal "Resource limit exceeded:
40
- # Buffer size limit exceeded, try XML_PARSE_HUGE" error mid-input.
41
- # In recover mode Nokogiri records that error on the document and
42
- # returns the partial tree, so every node past the limit silently
43
- # vanishes (lutaml-model#871). A resource-limit fatal means the
44
- # engine stopped early with input left — refuse to deserialize the
45
- # partial document instead of dropping trailing content without a
46
- # trace.
47
- #
48
- # moxml 0.5.84 and later always pass XML_PARSE_HUGE, so the
49
- # Nokogiri path no longer truncates and this guard stays silent;
50
- # it remains for older moxml releases and for any other adapter
51
- # that reports the resource-limit family.
52
- #
53
- # Other recover-mode fatals (e.g. an XML declaration after leading
54
- # whitespace) do not drop content and keep the long-standing
55
- # recover behavior; only the resource-limit family is truncating.
56
- TRUNCATION_FATAL_MARKER =
57
- /Resource limit exceeded|Buffer size limit exceeded/
58
-
59
33
  private
60
34
 
61
35
  def normalize_xml_for_parse(xml)
@@ -88,23 +62,6 @@ module Lutaml
88
62
  end
89
63
  end
90
64
 
91
- def assert_no_truncated_recovered_parse!(parsed)
92
- errors = parsed.parse_errors
93
- return if errors.nil? || errors.empty?
94
-
95
- fatal = errors.find do |message|
96
- message.match?(TRUNCATION_FATAL_MARKER)
97
- end
98
- return if fatal.nil?
99
-
100
- raise Lutaml::Model::InvalidFormatError.new(
101
- :xml,
102
- "the XML engine reported a fatal resource limit and recovered " \
103
- "with a truncated document; refusing to deserialize " \
104
- "partial input (#{fatal})",
105
- )
106
- end
107
-
108
65
  def parse_document_options(xml)
109
66
  {
110
67
  doctype: extract_doctype_from_xml(xml),
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lutaml-model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.104
4
+ version: 0.8.105
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.