v2.0.0
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:
-
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
, andpreceding-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 howexpect
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.AbstractResourceResolver
→core.model.AbstractResourceResolver
core.model.xml.ExternalConstraintsModulePostProcessor
→core.model.constraint.ExternalConstraintsModulePostProcessor
core.model.constraint.ISource
→core.model.ISource
databind.model.binding.metaschema.*
→databind.model.metaschema.binding.*
core/util/DefaultDiagramNode
→core/model/util/DefaultDiagramNode
core/util/IDiagramNode
→core/model/util/IDiagramNode
core/util/IDiagramNodeVisitor
→core/model/util/IDiagramNodeVisitor
core/util/MermaidErDiagramGenerator
→core/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 thenewInstance()
method, or a builder instance using thebuilder()
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
- Address insertion of duplicate external constraints by @david-waltermire in #188
- Bump lycheeverse/lychee-action from 1.10.0 to 2.0.2 by @dependabot in #186
- Bump github/codeql-action from 3.26.12 to 3.26.13 by @dependabot in #185
- Bump actions/upload-artifact from 4.4.1 to 4.4.3 by @dependabot in #182
- Bump org.apache.maven.plugin-tools:maven-plugin-annotations from 3.11.0 to 3.15.0 by @dependabot in #172
- Bump org.freemarker:freemarker from 2.3.32 to 2.3.33 by @dependabot in #171
- Ensure a double slash Metapath returns unique items by @david-waltermire in #187
- Added new convert metaschema-cli command. by @david-waltermire in #189
- Include constraint id in console output by @david-waltermire in #181
- Code refactoring 20241019 by @david-waltermire in #191
- Feature/bump minor version to 1.3 by @david-waltermire in #192
- Add
fn:string-length
to Metapath function registry by @aj-stein-gsa in #193 - Add substring-after impl to Metapath default function registry by @aj-stein-gsa in #195
- Add
substring-before()
implementation by @aj-stein-gsa in #194 - More refactoring and cleanup by @david-waltermire in #198
- Add
lower-case()
andupper-case()
to Metapath default function registry by @aj-stein-gsa in #203 - Bump actions/setup-java from 4.4.0 to 4.5.0 by @dependabot in #212
- Bump actions/checkout from 4.2.1 to 4.2.2 by @dependabot in #209
- Bump github/codeql-action from 3.26.13 to 3.27.0 by @dependabot in #206
- Bump org.junit:junit-bom from 5.11.2 to 5.11.3 by @dependabot in #201
- Bump com.github.spotbugs:spotbugs-maven-plugin from 4.8.6.4 to 4.8.6.5 by @dependabot in #200
- Bump org.apache.maven.plugins:maven-invoker-plugin from 3.8.0 to 3.8.1 by @dependabot in #199
- Bump org.apache.maven.plugin-tools:maven-plugin-annotations from 3.15.0 to 3.15.1 by @dependabot in #213
- Bump com.fasterxml.woodstox:woodstox-core from 7.0.0 to 7.1.0 by @dependabot in #210
- Avoid resolving an already resolved URI in doc-available by @david-waltermire in #214
- Refactoring of Module Loading API by @david-waltermire in #211
- Support for remarks in let statements by @david-waltermire in #216
- Address comments marked TODO by @david-waltermire in #217
- Eval command improvments by @david-waltermire in #228
- Improve NULL field value and data type error handling by @david-waltermire in #227
- Metapath additional axes by @david-waltermire in #229
- Bump org.apache.maven.plugins:maven-plugin-report-plugin from 3.15.0 to 3.15.1 by @dependabot in #226
- Bump org.apache.maven.plugins:maven-pmd-plugin from 3.25.0 to 3.26.0 by @dependabot in #225
- Bump org.apache.maven.plugins:maven-jxr-plugin from 3.5.0 to 3.6.0 by @dependabot in #224
- Bump dependency.pmd.version from 7.6.0 to 7.7.0 by @dependabot in #223
- Code cleanup by @david-waltermire in #230
- Bump org.xmlresolver:xmlresolver from 6.0.10 to 6.0.11 by @dependabot in #222
- Custom constraint messages by @david-waltermire in #218
- Handle validation runtime errors by @david-waltermire in #232
Full Changelog: v1.2.0...v2.0.0
Downloads
The metaschema-cli
can be downloaded from Maven central. zip tar.bz2