Skip to content

Releases: usnistgov/metaschema-java

v1.0.0-M1

26 Sep 20:46
Compare
Choose a tag to compare
v1.0.0-M1 Pre-release
Pre-release

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 to metaschema-core in folder core.
  • Relocated metaschema-model to metaschema-core in folder core.
  • Relocated metaschema-java-binding to metaschema-databind in folder databind.
  • Relocated metaschema-java-codegen to metaschema-databind in folder databind.
  • Moved metaschema-schema-generator from the folder metaschema-schema-generator to schemagen.
  • Setup JPMS module-info for the metaschema-core, metaschema-databind, and metaschema-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:

While imports have changed, most class names have remained stable. Some exceptions are:

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() and false() 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.
    • 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.
  • 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

Full Changelog: v0.12.2...v1.0.0-M1

Download

This release is on Maven Central.

v0.12.2

21 Sep 13:01
Compare
Choose a tag to compare

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

Full Changelog: v0.12.1...v0.12.2

Download

This release is on Maven Central.

v0.12.1

15 Sep 20:31
Compare
Choose a tag to compare

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

19 Jul 20:53
Compare
Choose a tag to compare

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

Full Changelog: v0.11.0...v0.12.0

Download

This release is on Maven Central.

v0.11.0

10 Jul 22:08
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.10.0...v0.11.0

Download

This release is on Maven Central.

v0.10.0

27 Oct 13:22
Compare
Choose a tag to compare

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

22 Aug 00:29
Compare
Choose a tag to compare

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

Full Changelog: v0.8.1...v0.9.0

Download

This release is on Maven Central.

v0.8.1

30 Jun 23:57
Compare
Choose a tag to compare

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

29 Jun 20:38
Compare
Choose a tag to compare

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

Full Changelog: v0.7.0...v0.8.0

Download

This release is on Maven Central.

v0.7.0

03 May 03:42
Compare
Choose a tag to compare

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.