public final class SpecVersionDetector extends Object
Modifier and Type | Method and Description |
---|---|
static SpecVersion.VersionFlag |
detect(com.fasterxml.jackson.databind.JsonNode jsonNode)
Detects schema version based on the schema tag: if the schema tag is not present, throws
JsonSchemaException with the corresponding message, otherwise - returns the detected spec version. |
static Optional<SpecVersion.VersionFlag> |
detectOptionalVersion(com.fasterxml.jackson.databind.JsonNode jsonNode)
|
public static SpecVersion.VersionFlag detect(com.fasterxml.jackson.databind.JsonNode jsonNode)
JsonSchemaException
with the corresponding message, otherwise - returns the detected spec version.jsonNode
- JSON Node to read frompublic static Optional<SpecVersion.VersionFlag> detectOptionalVersion(com.fasterxml.jackson.databind.JsonNode jsonNode)
Optional
value, otherwise - returns the detected spec version wrapped into Optional
.jsonNode
- JSON Node to read fromCopyright © 2023. All rights reserved.