Skip to content

Version 2.3.8

Compare
Choose a tag to compare
@highsource highsource released this 27 Dec 22:12
· 24 commits to master since this release

Release notes

  • Fixed a problem with minOccurs/maxOccurs generation (#62)
  • Corrected generation of simple/builtin types (#60)

All issues, fixed in this release

Backwards compatibility

With the fix for #60, Jsonix Schema Compiler now does a better job recognizing XML Schema built-in datatypes. For instance, you will now get types like UnsignedByte XML Schema xs:unsignedByte etc.

This means however, that with this release Jsonix Schema Compiler will generate different types compared to previous releases. This may break backwards compatibility.

Below is the list of affected types:

  • xs:anySimpleType -> AnySimpleType (previously AnyType)
  • xs:hexBinary -> HexBinary (previously String)
  • xs:dateTime -> DateTime (previously Calendar)
  • xs:date -> Date (previously Calendar)
  • xs:time -> Time (previously Calendar)
  • xs:gYearMonth -> GYearMonth (previously Calendar)
  • xs:gYear -> GYear (previously Calendar)
  • xs:gMonthDay -> GMonthDay (previously Calendar)
  • xs:gDay -> GDay (previously Calendar)
  • xs:gMonth -> GMonth (previously Calendar)
  • xs:unsignedLong -> UnsignedLong (previously Integer)
  • xs:unsignedInt -> UnsignedInt (previously Long)
  • xs:unsignedShort -> UnsignedShort (previously Int)
  • xs:unsignedByte -> UnsignedByte (previously Short)
  • xs:nonNegativeInteger -> NonNegativeInteger (previously Integer)
  • xs:nonPositiveInteger -> NonPositiveInteger (previously Integer)
  • xs:positiveInteger -> PositiveInteger (previously Integer)
  • xs:negativeInteger -> NegativeInteger (previously Integer)
  • xs:anyURI -> AnyURI (previously String)
  • xs:normalizedString -> NormalizedString (previously String)
  • xs:token -> Token (previously String)
  • xs:language -> Language (previously String)
  • xs:Name -> Name (previously String)
  • xs:NCName -> NCName (previously String)
  • xs:NMTOKEN -> NMTOKEN (previously String)
  • xs:NMTOKENS -> list of NMTOKEN (previously list of String)

Most of these changes are not dangerous as both old and new type are represented by the same JSON type. For instance, xs:Name was previously generated as String and now as Name - in both cases JSON type for this is string.

However there are three types where these changes are dangerous:

  • xs:dateTime -> DateTime (previously Calendar)
  • xs:date -> Date (previously Calendar)
  • xs:time -> Time (previously Calendar)

Former mapping was using the Calendar type which maps date/time values as a JSON structure. New mappings are using DateTime, Date and Time types. The problem is that with Jsonix versions up to 2.3.2 these types map date/time values as JavaScript Date object which is not compatible with the JSON structure mapped by Calendar.

This will be corrected in the next version of Jsonix. So if you upgrade to this release of the Jsonix Schema Compiler, you should also upgrade to Jsonix 2.4.0.