Skip to content

v2.0.0

Compare
Choose a tag to compare
@david-waltermire david-waltermire released this 03 Nov 17:36
· 22 commits to main since this release

This major release incorporates a bunch of bug fixes, new features, and code refactoring that will improve the stability of runtimes, and the maintainability of the code and use of the APIs.

What's New

  • In #189, the metaschema-cli convert command was added which allows for the conversion between supported formats for any content that conforms to a Metaschema module.

    usage: metaschema-cli convert --to=FORMAT -m=FILE_OR_URL [<options>] <source-file-or-URL> [<destination-file>]
     -h,--help               display this help message
     -m <FILE_OR_URL>        metaschema resource
        --no-color           do not colorize output
        --overwrite          overwrite the destination if it exists
     -q,--quiet              minimize output to include only errors
        --show-stack-trace   display the stack trace associated with an error
        --to=<FORMAT>        convert to format: xml, json, or yaml
        --version            display the application version
    
  • In #181, the logging produced by validation commands has been enhanced to also output the constraint id that the log message pertains to.

  • The following new Metapath functions were added:

    • fn:lower-case (#203)
    • fn:string-length() (#193)
    • fn:substring-after (#195)
    • fn:substring-before (#194)
    • fn:upper-case (#203)
  • let statements now fully support exposing the remark. Previously, this support was lacking for the pre-generated class bindings
    for the Metaschema.

  • The flag, following, following-sibling, preceding, and preceding-sibling axes are now implemented. See #229.

  • In allowed-values constraints, deprecated versions are now properly exposed in the related APIs.

  • All constraint types, except for allowed-values now support custom messages similar to how expect previously worked. See #218.

  • Runtime errors that occur while validation content using constraints sometimes caused the validation to exit prematurely before reporting validation errors. PR #232 now ensures that validation continues and these runtime issues are reported as validation errors.

  • Definition and instance properties are now fully supported in the class binding APIs.

  • The metaschema-cli eval command now outputs the value for flag and field nodes in addition to the path to the node. See #228.

  • Due to the differences between how null values are handled in XML and JSON/YAML, the parser will now report warnings when a null value is found. See #227 for more information on this behavior.

Bug Fixes

  • PR #188 addressed #184 by ensuring that only one copy of a constraint is added at a given location within a model. This issues was caused when an external constraint applied to multiple locations within a model and that model construct was reused in one or more of those locations. A copy of the constraint was added for each time the constraint target matches one of those locations.
  • PR #187 addressed the case where a search path (//somenode). In such cases, the matched nodes were returned multiple times. This fix ensure that the nodes returned are unique.
  • PR #214 fixes the case where if the fn:doc-available Metapath function is called with an absolute URI, the function was trying to still resolve it. This would cause an error when the static context doesn't have a baseUri set. The behavior has been changed to only try resolution when the URI is not absolute.

Breaking Changes

  • Some implementation classes and interfaces haven been moved or renamed. The following is a summary of the changes.

    In package gov.nist.secauto.metaschema:

    • core.resource.AbstractResourceResolvercore.model.AbstractResourceResolver
    • core.model.xml.ExternalConstraintsModulePostProcessorcore.model.constraint.ExternalConstraintsModulePostProcessor
    • core.model.constraint.ISourcecore.model.ISource
    • databind.model.binding.metaschema.*databind.model.metaschema.binding.*
    • core/util/DefaultDiagramNodecore/model/util/DefaultDiagramNode
    • core/util/IDiagramNodecore/model/util/IDiagramNode
    • core/util/IDiagramNodeVisitorcore/model/util/IDiagramNodeVisitor
    • core/util/MermaidErDiagramGeneratorcore/model/util/MermaidErDiagramGenerator
  • The interface gov.nist.secauto.metaschema.databind.IBindingContext has been significantly changes. You can no longer get a global shared instance. Instead, you can get a new instance using the newInstance() method, or a builder instance using the builder() method. These changes were made in #211.

    By default, new instances do not support dynamically generating and compiling class bindings. This can be enabled by calling the compilePath(Path) using the builder instance.

What's Changed

Full Changelog: v1.2.0...v2.0.0

Downloads

The metaschema-cli can be downloaded from Maven central. zip tar.bz2