Skip to content

Update usages of com.networknt:json-schema-validator to the new API. ( 1.5.9 -> 2.0.1 )#802

Open
pedroboado wants to merge 1 commit intoCycloneDX:masterfrom
pedroboado:bump-json-schema-validator-2.x
Open

Update usages of com.networknt:json-schema-validator to the new API. ( 1.5.9 -> 2.0.1 )#802
pedroboado wants to merge 1 commit intoCycloneDX:masterfrom
pedroboado:bump-json-schema-validator-2.x

Conversation

@pedroboado
Copy link

Migrate from the removed 1.x API to the 2.x equivalents:

  • JsonSchemaFactory → SchemaRegistry (builder pattern)
  • JsonSchema → com.networknt.schema.Schema
  • SchemaValidatorsConfig → SchemaRegistryConfig
  • MapSchemaMapper → MapResourceLoader (now maps IRI to schema content)
  • ValidationMessage → Error; Set → List

Update JsonParseTest to reflect that Error.getMessage() no longer prefixes the instance location (e.g. "$: ") to the message text.

….0.1

Migrate from the removed 1.x API to the 2.x equivalents.
Update JsonParseTest to reflect that Error.getMessage() no longer
prefixes the instance location (e.g. "$: ") to the message text.

Signed-off-by: Pedro Boado <pedro.boado@datadoghq.com>
Copy link
Contributor

@sschuberth sschuberth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM besides my nit comment.

* @since 6.0.0
*/
public JsonSchema getJsonSchema(Version schemaVersion, final ObjectMapper mapper)
public com.networknt.schema.Schema getJsonSchema(Version schemaVersion, final ObjectMapper mapper)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason not to import Scheme?

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.

2 participants