Skip to content

Fix generate-schema format diagnostics - #428

Open
mcc0nnell wants to merge 1 commit into
usnistgov:developfrom
mcc0nnell:fix/generate-schema-format-diagnostics
Open

Fix generate-schema format diagnostics#428
mcc0nnell wants to merge 1 commit into
usnistgov:developfrom
mcc0nnell:fix/generate-schema-format-diagnostics

Conversation

@mcc0nnell

Copy link
Copy Markdown

Align generate-schema --as help and invalid-format diagnostics with
ISchemaGenerator.SchemaFormat (JSON and XML only). YAML is no longer
advertised as a valid generated-schema format.

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Have you squashed any non-relevant commits and commit messages?
  • Do all automated CI/CD checks pass?

Fork Actions failed before compile: gov.nist.secauto:oss-parent:pom:28-SNAPSHOT is absent from oss.sonatype.org (pre-existing on develop). Local validation of this change passed.

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you included examples of how to use your new feature(s)?
  • Have you updated all website and readme documentation affected by the changes you made?

What

Align generate-schema --as help and invalid-value diagnostics with the
formats actually supported by ISchemaGenerator.SchemaFormat.

Why

SchemaFormat currently supports only JSON and XML, but the error path
enumerates the broader databind Format enum and therefore advertises YAML.
The option help also describes --as as a source format and lists YAML.

Changes

  • describe --as as the generated schema format
  • derive valid choices from SchemaFormat.values()
  • add regression tests for the help text and invalid YAML diagnostic

Validation

mvn -B -pl metaschema-cli -am -Dtest=GenerateSchemaCommandTest -Dsurefire.failIfNoSpecifiedTests=false test
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0
BUILD SUCCESS
mvn -B -pl metaschema-cli -am -Prelease verify 
-Dtest=GenerateSchemaCommandTest -Dsurefire.failIfNoSpecifiedTests=false
Checkstyle: 0 violations
SpotBugs: 0
GenerateSchemaCommandTest: 2/2 passed
BUILD SUCCESS
Fixes #

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant