Skip to content

unify-jdocs-1.5.0

Compare
Choose a tag to compare
@deepakarora3 deepakarora3 released this 22 Aug 19:24

IMPORTANT -> Please read carefully as this release may break running code in one specific scenario.

In March of this year, we had released a version of unify-jdocs which provided the "validate at read write only" feature. What this feature did was that if set to true, it would validate the document against the model only when reading or writing from the document. Unfortunately, the regex validations for values being read had gotten missed out which this release fixes. So, if you have not used this feature i.e. have not ever set validate at read write only to true either while initializing JDocs or while creating a typed document / setting the type of a document, then you are good meaning that you are not impacted.

If, however, you have used this feature and if you have regex validations defined and you read that path from the document, then the regex validations would not have fired. If now you upgrade to this release, you will need to make sure that the paths in the typed documents that you read and the corresponding regex in the model document are in sync else an exception would be thrown.

In addition to fixing above, the set type method also now throws an exception in the following two situations:

  1. An empty string is provided for type field
  2. The document is already a typed document and the type being set is different from the existing type

Please raise issues and I am happy to help. Thanks.