Releases: usnistgov/metaschema-java
v1.0.0-M1
New and Notable
This pre-release represents a major refactoring of this library, with a focus on stabalizing APIs and laying the groundwork for ongoing maintenance and extension.
As part of this release, a number of existing modules have been retired, with the code migrated and merged into two new modules.
- Relocated
metaschema-model-common
tometaschema-core
in foldercore
. - Relocated
metaschema-model
tometaschema-core
in foldercore
. - Relocated
metaschema-java-binding
tometaschema-databind
in folderdatabind
. - Relocated
metaschema-java-codegen
tometaschema-databind
in folderdatabind
. - Moved
metaschema-schema-generator
from the foldermetaschema-schema-generator
toschemagen
. - Setup JPMS module-info for the
metaschema-core
,metaschema-databind
, andmetaschema-schema-generator
modules. This provides a means to isolate APIs from implementation.
The APIs have also migrated to different package names. The primary packages are now:
- core: gov.nist.secauto.metaschema.core
- databind: gov.nist.secauto.metaschema.databind
- schemagen: gov.nist.secauto.metaschema.schemagen
While imports have changed, most class names have remained stable. Some exceptions are:
- Renamed
gov.nist.secauto.metaschema.model.common.IMetaschema
togov.nist.secauto.metaschema.core.model.IModule
to be more consistent with terminology. - Removed remove the
gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValue*
interfaces. Use thegov.nist.secauto.metaschema.core.metapath.item.node.I*
interfaces instead.
Overall code and repo improvements:
- Cleaned up some unused/unneeded classes and methods.
- Cleaned up some unneeded generics in the implementation.
- Added many Javadoc comments.
- Relocated unit tests to match new package structure.
- Added a new mock model builder (MockedModelTestSupport) to facilitate creation of unit tests around using a mocked Metaschema model.
- Some Maven dependency cleanup, including removing unused dependencies.
- Removed dependency on JAXB.
- Updating to latest oss-maven release.
- Removed aggregate javadoc.
- Eliminated a significant number of compile, PMD, CPD duplications, and Spotbugs warnings.
- Improved some logging messages.
- Use treeless Git clones on GHA builds
The following changes were made to the metaschema-core
module:
- Metapath:
- Added
true()
andfalse()
Metapath functions. - Added support for function namespaces.
- Refactored Metapath focus to allow for Metapath evaluations against no focus, as well as cases where the focus is not a node item.
- Refactored error handling for step-related Metapath expressions to ensure the provided context node item is non-null and a document. This allows null node contexts in Metapath expressions that do not require a focused node.
- Added new String initializer for IAnyAtomicItem.
- Refactored node item implementation to provide better interface segregation and to limit class responsibility.
- Refactored INodeItem handling to implement the following correct behaviors:
- IDocumentNodeItem instances will never have a value (i.e. getValue == null)
- Root metapaths (i.e.
/
) must be executed against an IDocumentNodeItem or an error should be raised.
- Refactored INodeItem handling to implement the following correct behaviors:
- Improved memory footprint for Axis expressions, which now use static objects for evaluation. Refactored the Step and ParentItem ASTs to use the new Axis support.
- Added
- Metaschema Model
- Removed collapsible per usnistgov/metaschema#354.
- Moved property info factory to static method on IModelPropertyInfo.
- Adjusted IDataTypeHandler creation to avoid extra method callbacks.
- Removed the need for specific root assembly model interfaces and classes.
- Reduced unnecessary overridden methods.
- For index constraints, enhanced index key miss error reporting to include the key data that missed.
The following changes were made to the metaschema-databind
module:
- Refactored JSON parsing, extracting JSON parsing logic into the MetaschemaJsonParser class. This resulted in a cleaner set of bound definition/property classes that no contain no parsing code.
- Implemented the JSON problem handler. Resolved #131.
- Refactored JSON parser tests.
- Refactored JSON reader and writer to use common instance logic. The collection of instances are now lazy generated and cached, improving read and write performance for commonly accessed Metaschema-based JSON objects.
- Adjusted YAML parser configuration to set a higher default codepoint limit.
- Refactored XML parsing, extracting XML parsing logic into the MetaschemaXmlReader class. This resulted in a cleaner set of bound definition/property classes.
- Also optimized deserialization to return the Object value directly, instead of first creating an unneeded node item.
- Implemented XML problem handler for parsing. Further code cleanup and refactoring of XML parsing code.
- Adjusted all problem handlers to use interface defaults and a common implementation of default handling for missing instances.
- Refactored input stream handling. Input streams should now be properly closed.
- Refactored binding context to allow for dynamic class generation, compilation, and loading. Removed DynamicBindingContext.java, which is no longer needed.
- Refactored code generation, moving code generation methods into a dedicated class.
- Refactored code generation production classes to simplify and reduce the number of classes.
The following changes were made to the metaschema-schema-generator
module:
- Refactored XML and JSON generation by moving generation code into format specific classes (i.e. MetaschemaJsonWriter, MetaschemaXmlWriter).
- Improved XML schema generation testing.
The following changes were made to the metaschema-maven-plugin
module:
- Adjusted generate sources mojo default phase to a more reasonable value (generate-sources).
Changes to the Website:
- Cleaned up website reports.
- Ensured generated resources are included for site generation.
What's Changed
- Bump actions/setup-java from 3.11.0 to 3.13.0 by @dependabot in #220
- Bump github/codeql-action from 2.21.7 to 2.21.8 by @dependabot in #219
- Bump actions/checkout from 4.0.0 to 4.1.0 by @dependabot in #221
- Code refactoring and cleanup for 1.0.0 release by @david-waltermire-nist in #204
Full Changelog: v0.12.2...v1.0.0-M1
Download
This release is on Maven Central.
v0.12.2
New and Notable
This is a patch release to fix a defect causing data type references to be omitted for attributes in XML Schema generated using the schema generation function of this library.
The core repository documentation has been updated, which includes information on the testing approach used by this project.
What's Changed
- Fix missing type reference on generated attributes for flags by @david-waltermire-nist in #218
- Feature improve core docs by @david-waltermire-nist in #213
Full Changelog: v0.12.1...v0.12.2
Download
This release is on Maven Central.
v0.12.1
New and Notable
This patch release was made to fix a build pipeline problem. It is functionally the same as the v0.12.0 release.
What's Changed
This patch release changed no Java code.
Full Changelog: v0.12.0...v0.12.1
Download
This release is on Maven Central.
v0.12.0
New and Notable
- In v0.11.0 SnakeYAML was upgraded to a newer version that restricted the maximum codepoints read to 3MB. This release increases this value to 2GB and allows this limit to be set to a different value using the DeserializationFeature.YAML_CODEPOINT_LIMIT.
- Support was added for Metaschema-based content validation using an arbitrary Metaschema in the CLI using the
validate-content command
. This command requires a-m
argument pointing to the Metaschema to use. It automatically compiles the binding classes and generates the appropriate XML or JSON schema for content validation.
What's Changed
- Set 2GB SnakeYaml codepoint limit by @david-waltermire-nist in #192
- Bump maven-build-cache-extension from 1.0.0 to 1.0.1 by @dependabot in #194
- CLI Metaschema-based content validation by @david-waltermire-nist in #196
- Handle RuntimeExceptions that occur during command execution by @david-waltermire-nist in #197
Full Changelog: v0.11.0...v0.12.0
Download
This release is on Maven Central.
v0.11.0
What's Changed
- Add schema generation mojo by @david-waltermire-nist in #103
- Support inclusion of allowed values in generated XML and JSON Schema by @david-waltermire-nist in #133
- Allow leading zeros in IPv6 addresses by @aj-stein-nist in #158
- Expand support for Markdown to HTML conversion by @david-waltermire-nist in #159
- Fixed key generation to address empty keys. Refactored index classes.… by @david-waltermire-nist in #171
- Add "$id" property to generated JSON definitions by @david-waltermire-nist in #175
- Adopt metaschema 0.9.0 by @david-waltermire-nist in #182
- Migrate cli framework by @david-waltermire-nist in #176
- Properly handle whitespace with HTML tags by @david-waltermire-nist in #183
- Avoid logging validation exceptions by @david-waltermire-nist in #184
- Improve required CLI flag handling by @david-waltermire-nist in #186
- Add support for yaml nulls by @david-waltermire-nist in #185
- Code cleanup by @david-waltermire-nist in #191
- Bump dependency.log4j2.version from 2.18.0 to 2.19.0 by @dependabot in #127
- Bump dependency.log4j2.version from 2.19.0 to 2.20.0 by @dependabot in #162
- Bump plexus-utils from 3.4.2 to 3.5.0 by @dependabot in #129
- Bump plexus-utils from 3.5.0 to 4.0.0 by @dependabot in #163
- Bump antlr4test-maven-plugin from 1.21 to 1.22 by @dependabot in #128
- Bump jaxen from 1.2.0 to 2.0.0 by @dependabot in #140
- Bump maven-plugin-annotations from 3.6.4 to 3.7.0 by @dependabot in #134
- Bump maven-plugin-annotations from 3.7.0 to 3.9.0 by @dependabot in #179
- Bump maven-invoker-plugin from 3.3.0 to 3.5.0 by @dependabot in #153
- Bump maven-invoker-plugin from 3.5.0 to 3.6.0 by @dependabot in #180
- Bump mojo.maven.version from 3.8.6 to 3.8.7 by @dependabot in #148
- Bump mojo.maven.version from 3.8.7 to 3.9.2 by @dependabot in #172
- Bump mojo.maven.version from 3.9.2 to 3.9.3 by @dependabot in #177
- Bump freemarker from 2.3.31 to 2.3.32 by @dependabot in #150
- Bump ipaddress from 5.3.4 to 5.4.0 by @dependabot in #146
- Bump commons-io from 2.11.0 to 2.13.0 by @dependabot in #174
- Bump Saxon-HE from 11.4 to 12.2 by @dependabot in #173
- Bump Saxon-HE from 12.2 to 12.3 by @dependabot in #189
- Bump everit-json-schema from 1.14.1 to 1.14.2 by @dependabot in #181
- Bump inject-resources-junit-jupiter from 0.3.2 to 0.3.3 by @dependabot in #178
- Bump git-commit-id-maven-plugin from 5.0.0 to 6.0.0 by @dependabot in #187
- Bump actions/setup-java from 3.6.0 to 3.7.0 by @dependabot in #139
- Bump actions/setup-java from 19eeec562b37d29a1ad055b7de9c280bd0906d8d to c3ac5dd0ed8db40fedb61c32fbe677e6b355e94c by @dependabot in #141
- Bump actions/setup-java from 3.8.0 to 3.10.0 by @dependabot in #152
- Bump actions/setup-java from 3.10.0 to 3.11.0 by @dependabot in #164
- Bump actions/checkout from 3.1.0 to 3.3.0 by @dependabot in #149
- Bump actions/checkout from 3.3.0 to 3.5.3 by @dependabot in #167
- Bump github/codeql-action from 2.1.28 to 2.1.29 by @dependabot in #130
- Bump github/codeql-action from 2.1.29 to 2.1.35 by @dependabot in #138
- Bump github/codeql-action from 2.1.35 to 2.1.36 by @dependabot in #142
- Bump github/codeql-action from 2.1.36 to 2.20.1 by @dependabot in #170
- Bump github/codeql-action from 2.20.1 to 2.20.2 by @dependabot in #188
- Bump github/codeql-action from 2.20.2 to 2.20.3 by @dependabot in #190
New Contributors
- @aj-stein-nist made their first contribution in #158
Full Changelog: v0.10.0...v0.11.0
Download
This release is on Maven Central.
v0.10.0
What's Changed
- Metapath enhancements to support constraints by @david-waltermire-nist in #126
- Added support for formal names, descriptions, and properties on constraints.
- Added support for serializing constraints as part of metaschema serialization to XML.
- Multiple metapath enhancements:
- Added support for XPath 3.1 let statements (experimental).
- Added new recurse-depth function for recursive resolution of linked documents.
- Added support for the XPath 3.1 path function, which returns a Metapath.
- Updated to latest metaschema
- Bump actions/setup-java from 3.4.1 to 3.6.0 by @dependabot in #125
- Bump github/codeql-action from 2.1.18 to 2.1.28 by @dependabot in #124
- Bump actions/checkout from 2 to 3.1.0 by @dependabot in #122
- Bump checkstyle from 10.3.2 to 10.3.4 by @dependabot in #118
- Bump spotbugs-annotations from 4.7.1 to 4.7.2 by @dependabot in #112
- Bump xmlbeans from 5.1.0 to 5.1.1 by @dependabot in #110
- Bump maven-checkstyle-plugin from 3.1.2 to 3.2.0 by @dependabot in #107
- Bump org.eclipse.persistence.moxy from 3.0.2 to 3.0.3 by @dependabot in #105
- Fixed some compile warnings, PMD, and spotbugs issues.
Full Changelog: v0.9.0...v0.10.0
Download
This release is on Maven Central.
v0.9.0
What's Changed
- Fixed allowed values behavior during validation by @david-waltermire-nist in #74
- Refactored IConstraintValidator API to avoid misuse by calling the previous validate methods directly, instead of the visitor method.
- Fixed allowed values validation logic preventing constraint sets allowing other values to fail. Fixes #76.
- Documentation improvements by @david-waltermire-nist in #86
- Updating to latest metaschema schema.
- Renamed IBoundNamedModelDefinition to IBoundModelDefinition.
- Renamed INamedDefinitionTypeInfo to IDefinitionTypeInfo.
- Renamed INamedModelDefinitionTypeInfo to IModelDefinitionTypeInfo.
- Renamed IInlineNamedDefinition to IInlineDefinition.
- Renamed INamedModelDefinition to IModelDefinition.
- Removed INamedValuedDefinition; using IValuedDefinition instead.
- Removing INamedDefinition; using IDefinition instead.
- Added support for arbitrary properties in a Metaschema definition or instance.
- Added support for formal-name and description.
- Addressed cycle handling in Metapath evaluation against models with definition cycles.
- Started work on reference documentation generation.
- Setup spotbugs by @david-waltermire-nist in #92
- Configured spotbugs for static analysis. Resolves #84.
- Fixed compile warnings, and PMD and spotbugs errors.
- Switched null analysis annotations to use spotbugs provided annotations.
- Support for default values and some additional fixes by @david-waltermire-nist in #100
- Added support for default values in the core Metaschema models, including the XML and bound Java object implementations.
- Refactored binding annotations to provide a more maintainable implementation.
- Cleaned up and moved some Metaschema data type classes.
- Fixed a bug causing binding errors for fields that are not bound on a bound class.
- Fixed a defect in generating assembly constraints.
- Added method to iterate over an ISequence
- Refactored build to eliminate extraneous dependencies.
- Refactoring index constraints by @david-waltermire-nist in #102
- Refactored index constraints to use the new IIndex class. This will help in the future with further enhancements around use of indexes.
- Added and integrated a ConstraintValidationFinding builder for generating new findings.
- Improved error handling to emit validation errors instead of exceptions. This will result in the reporting of index lookup misses as findings.
Dependency Changes
- Bump actions/setup-java from 3.4.0 to 3.4.1 by @dependabot in #79
- Bump checkstyle from 10.3.1 to 10.3.2 by @dependabot in #91
- Bump compiler from 2.21ea82 to 2.23ea0 by @dependabot in #82
- Bump extra-enforcer-rules from 1.5.1 to 1.6.1 by @dependabot in #85
- Bump github/codeql-action from 2.1.15 to 2.1.16 by @dependabot in #81
- Bump github/codeql-action from 2.1.16 to 2.1.17 by @dependabot in #90
- Bump github/codeql-action from 2.1.17 to 2.1.18 by @dependabot in #97
- Bump javaparser-symbol-solver-core from 3.24.2 to 3.24.4 by @dependabot in #96
- Bump junit-platform-launcher from 1.8.2 to 1.9.0 by @dependabot in #88
- Bump log4j2 from 2.17.2 to 2.18.0 by @dependabot in #75
- Bump Saxon-HE from 11.3 to 11.4 by @dependabot in #89
- Bump spotbugs-annotations from 4.2.0 to 4.7.1 by @dependabot in #93
- Bump woodstox-core from 6.3.0 to 6.3.1 by @dependabot in #99
- Bump xmlresolver from 4.4.0 to 4.4.3 by @dependabot in #83
- Bump xmlresolver from 4.4.3 to 4.5.1 by @dependabot in #101
Full Changelog: v0.8.1...v0.9.0
Download
This release is on Maven Central.
v0.8.1
What's Changed
- Adjusted metaschema-java-binding/src/main/java/gov/nist/secauto/metaschema/binding/io/ISerializer to use UTF-8 when serializing to an OutputStream by @david-waltermire-nist in #72
Full Changelog: v0.8.0...v0.8.1
Download
This release is on Maven Central.
v0.8.0
What's Changed
- Added support for using external constraint definition sets with existing Metaschema models by @david-waltermire-nist in #65
- Added support for defining a constraint validation handler on a deserializer. Resolves usnistgov/liboscal-java#19 by @david-waltermire-nist in #66
- Multiple improvements by @david-waltermire-nist in #67
- Reducing compile, PMD, and checkstyle warnings.
- Added support for allowed value constraint extensibility configuration
- Reduced visibility of implementation classes.
- Multiple improvements by @david-waltermire-nist in #71
- Improved error messages in constraint validator to help diagnose malformed constraints.
- Added exception handling on metapath evaluation to show the metapath causing the error.
- Fixed PMD, checkstyle, and Java compile warnings.
- Improved Javadoc-based documentation
Dependencies
- Bump mojo.maven.version from 3.8.4 to 3.8.5 by @dependabot in #33
- Bump Saxon-HE from 11.2 to 11.3 by @dependabot in #34
- Bump dependency.flexmark.version from 0.62.2 to 0.64.0 by @dependabot in #31
- Bump dependency.antlr4.version from 4.9.2 to 4.10.1 by @dependabot in #30
- Bump compiler from 2.4.1 to 2.21ea82 by @dependabot in #39
- Bump dependency.log4j2.version from 2.17.1 to 2.17.2 by @dependabot in #38
- Bump jackson-databind from 2.13.2.2 to 2.13.3 by @dependabot in #37
- Bump inject-resources-junit-jupiter from 0.3.0 to 0.3.2 by @dependabot in #35
- Bump jaxb-impl from 3.0.0 to 4.0.0 by @dependabot in #46
- Bump org.eclipse.persistence.moxy from 3.0.0 to 3.0.2 by @dependabot in #43
- Bump maven-invoker-plugin from 3.2.1 to 3.3.0 by @dependabot in #44
- Bump license-maven-plugin from 4.0.rc1 to 4.2.rc3 by @dependabot in #42
- Bump commons-io from 2.8.0 to 2.11.0 by @dependabot in #40
- Bump dependency.jackson.version from 2.13.2 to 2.13.3 by @dependabot in #48
- Bump github/codeql-action from 2.1.11 to 2.1.12 by @dependabot in #45
- Bump ipaddress from 5.3.3 to 5.3.4 by @dependabot in #51
- Bump woodstox-core from 6.2.7 to 6.2.8 by @dependabot in #50
- Bump maven-plugin-annotations from 3.2 to 3.6.4 by @dependabot in #52
- Bump commons-lang3 from 3.11 to 3.12.0 by @dependabot in #49
- Bump everit-json-schema from 1.14.0 to 1.14.1 by @dependabot in #56
- Bump freemarker from 2.3.30 to 2.3.31 by @dependabot in #55
- Bump antlr4test-maven-plugin from 1.17 to 1.21 by @dependabot in #57
- Bump xmlresolver from 4.2.0 to 4.3.0 by @dependabot in #58
- Bump oss-parent from 20 to 21 by @dependabot in #63
- Bump inject-resources-core from 0.3.0 to 0.3.2 by @dependabot in #62
- Bump mojo.maven.version from 3.8.5 to 3.8.6 by @dependabot in #61
- Bump actions/setup-java from 3 to 3.4.0 by @dependabot in #60
- Bump github/codeql-action from 2.1.12 to 2.1.13 by @dependabot in #59
- Bump xmlbeans from 5.0.3 to 5.1.0 by @dependabot in #54
- Bump github/codeql-action from 2.1.13 to 2.1.14 by @dependabot in #64
- Bump xmlresolver from 4.3.0 to 4.4.0 by @dependabot in #69
- Bump woodstox-core from 6.2.8 to 6.3.0 by @dependabot in #68
- Bump github/codeql-action from 2.1.14 to 2.1.15 by @dependabot in #70
Full Changelog: v0.7.0...v0.8.0
Download
This release is on Maven Central.
v0.7.0
What's Changed
- Add schema generation support by @david-waltermire-nist in #25
- Add support for add/remove collection operations by @david-waltermire-nist in #27
- Parsing and writing speed improvements for JSON and YAML.
- Implemented JSON schema generation. Resolves usnistgov/OSCAL#1145. Resolves usnistgov/OSCAL#1132. Resolves usnistgov/OSCAL#1131. Resolves usnistgov/OSCAL#1003.
- Worked out unicode support for JSON and XSD. Resolves usnistgov/OSCAL#1127. Resolves usnistgov/OSCAL#956.
- Fixed bugs in DateAdapter causing dates without timezones to not parse or write properly.
- Refactored and moved validation API to metaschema-model-common.
- Fixed a bug in write operations causing some file contents to not be truncated when overwriting files. Added StandardOpenOption.TRUNCATE_EXISTING to write operations.
- Fixed a bug in array writing for properties using in-json=ARRAY or SINGLETON_OR_ARRAY, that caused an error related to the closing array syntax.
- Refactored Java class generation to provide more information to the caller about generated classes.
- Added dynamic test support for Metaschema-based testing in a new module metaschema-testing.
- Updated JSON parsing code to be more resilient.
- Updated to new metaschema feature branch for major refactor.
- Fixed some compiler, PMD, and checkstyle warnings. Making incremental progress towards getting these cleaned up.
- Simplified and removed some unneeded interfaces and abstract classes. Reducing public/protected classes and methods.
- Fixed bugs around inline type handling in schema generation.
- Migrated the metaschema-java-binding-annotations module sources to metaschema-java-binding.
- Completed full support for Metaschema information in bound Java classes.
- Refactored Metapath function library, adding functions for abs, boolean, ceiling, compare, data, floor, and round. Identified all functions that need to be implemented eventually.
- Added some Javadocs.
- Fixing relative path in POM causing build errors in CI.
Full Changelog: v0.6.0...v0.7.0
Download
This release is on Maven Central.