Project

General

Profile

Task #7910

Story #7832: migrate from JibX to JAXB for XML binding / codegen

schema validation behavior

Added by Rob Nahf about 5 years ago. Updated almost 4 years ago.

Status:
New
Priority:
Normal
Assignee:
Category:
d1_common_java
Target version:
-
Start date:
2016-10-12
Due date:
% Done:

0%

Milestone:
None
Product Version:
*
Story Points:
Sprint:

Description

unmarshalling objects using JAXB (without schema validation) can lead to changes in the values. For example, an invalid date leaves the corresponding Date property as null, instead of throwing an exception. I don't know what JiBX did in this situation.

Duplicate "identifier" fields in the systemMetadata, for example, doesn't cause problems - one of the identifier values is simply ignored.

Is this ok, or should we be schema validating when we unmarshal? How much did JiBX catch and alert us to in the past? there were no unit tests dedicated to this issue.

History

#1 Updated by Rob Nahf almost 4 years ago

TypeMarshaller currently validates upon marshalling (by default - there's a property setting to control this) but not on unmarshalling. validation on marshalling was added to mimic the JiBX behavior.

TypeMarshaller is the place to add it. This looks like a decent how-to: https://docs.oracle.com/cd/E19575-01/819-3669/bnbbc/index.html

#2 Updated by Rob Nahf almost 4 years ago

Consider putting this in 2.4.0 to simplify changing dependencies.

#3 Updated by Dave Vieglais almost 4 years ago

  • Assignee changed from Robert Waltz to Rob Nahf

#4 Updated by Dave Vieglais almost 4 years ago

  • Sprint set to CCI-2.4.0

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 14.8 MB)