moxml 0.5.122 → 0.5.123

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: 5366b1e4d4b177747964da2c010c7b45a93fd31d71b0ec06b531c87fcee8fd95
4
- data.tar.gz: d7bd6f17cadea96f07c861dcd753201076e9f5b98c7f60c9ac8d965bdfe6cbfc
3
+ metadata.gz: aba5868bf7db2136823ceac2c98f825cad89b1c8f7b8e34d9ac1de2c7cbe1e61
4
+ data.tar.gz: 3b8cdeb8e497d73d0c2d7db37c5f3af95e5a7bc165a6cbad8a68bb2b3cec2913
5
5
  SHA512:
6
- metadata.gz: '0980aadf7e42a333fa96984c945b7b2b4954ca7fefa32972e5ac29dd85a27b1334a461b88f278769a70776e7207f684848e588735d47ddb66420a5781fd1542a'
7
- data.tar.gz: 51a9461b90b4df2b5a56c47f68f35f6eaf4338822bb153c9ec5d53db05b390540e16f516f5bcc72c30dc376297551f8d3e0e1f623d4464f93ac821cf7c8b6048
6
+ metadata.gz: 92aabda5d25c00d5c2d81fa3103ad4580f1e6774827057541659000cb3344e1e056cd922d4ce96a04975d6c29692fa087948a31c41de7d60cd5227f77aff382b
7
+ data.tar.gz: 28cfbef33282d28a6eb0f94c248cbf36399cb8911430b468f9c67f890e2be684d8926d2670c346f54ab7aad9cfb0085f87bfc09dbeb9fed83c8b029e79997134
@@ -279,14 +279,17 @@ module Moxml
279
279
 
280
280
  def xsd_validate(xsd_handle, native_document)
281
281
  # +xsd_handle+ is the binding's Leptris::XML::XSD::Schema;
282
- # validate_errors takes the binding document and returns
283
- # the engine's accumulated messages ([] = valid).
282
+ # validate_errors takes the binding document. Entries
283
+ # normalize to Strings: the moxml contract is []-of-
284
+ # messages, and the binding may enrich entries into
285
+ # structured objects (element/line/column —
286
+ # leptris-ruby#419) without breaking consumers.
284
287
  doc = if native_document.is_a?(::Leptris::XML::Document)
285
288
  native_document
286
289
  else
287
290
  to_binding(native_document)
288
291
  end
289
- xsd_handle.validate_errors(doc)
292
+ xsd_handle.validate_errors(doc).map(&:to_s)
290
293
  end
291
294
 
292
295
  def builder_face(native_document)
data/lib/moxml/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Moxml
4
- VERSION = "0.5.122"
4
+ VERSION = "0.5.123"
5
5
  end
@@ -123,6 +123,13 @@ RSpec.describe Moxml::XSD do
123
123
  expect(schema.instance_variable_get(:@parsed_source)).to be_nil
124
124
  end
125
125
 
126
+ it "normalizes validate entries to strings (moxml contract)" do
127
+ schema = ctx.xsd(schema_text)
128
+ errors = schema.validate("<note><wrong/></note>")
129
+ expect(errors).not_to be_empty
130
+ expect(errors).to all(be_a(String))
131
+ end
132
+
126
133
  it "derives XSD_SUPPORTED from the engine face gate" do
127
134
  # The capability flag must not outrun the engine faces: a
128
135
  # misreleased lockstep (NATIVE_PLAN_STRUCTS lesson) would arm
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moxml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.122
4
+ version: 0.5.123
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.