Package com.networknt.schema.utils
Class JsonNodeTypes
java.lang.Object
com.networknt.schema.utils.JsonNodeTypes
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanequalsToSchemaType(tools.jackson.databind.JsonNode node, JsonType schemaType, Schema parentSchema, SchemaContext schemaContext, ExecutionContext executionContext) static booleanisNodeNullable(tools.jackson.databind.JsonNode schema) static booleanisNonFiniteNumber(tools.jackson.databind.JsonNode node) Check if the node is a number and is one of NaN, Infinity or -Infinitystatic booleanisNullableAncestor(ExecutionContext executionContext) Determines whether the value currently being validated is declared nullable, either by the schema owning the executing keyword or by an ancestor that describes the same value.static booleanisNumber(tools.jackson.databind.JsonNode node, SchemaRegistryConfig config) Check if the type of the JsonNode's value is number based on the status of typeLoose flag.
-
Constructor Details
-
JsonNodeTypes
public JsonNodeTypes()
-
-
Method Details
-
isNodeNullable
public static boolean isNodeNullable(tools.jackson.databind.JsonNode schema) -
equalsToSchemaType
public static boolean equalsToSchemaType(tools.jackson.databind.JsonNode node, JsonType schemaType, Schema parentSchema, SchemaContext schemaContext, ExecutionContext executionContext) -
isNullableAncestor
Determines whether the value currently being validated is declared nullable, either by the schema owning the executing keyword or by an ancestor that describes the same value.The walk descends the evaluation stacks, which record both the schemas entered and the keyword each one was entered by, and stops at the first keyword that moves to a different value such as
propertiesoritems. It must therefore be called while a validation is in flight; outside one the stacks are empty and the result is false.- Parameters:
executionContext- the execution context of the in-flight validation- Returns:
- true if the value being validated is declared nullable
-
isNumber
Check if the type of the JsonNode's value is number based on the status of typeLoose flag.- Parameters:
node- the JsonNode to checkconfig- the SchemaValidatorsConfig to depend on- Returns:
- boolean to indicate if it is a number
-
isNonFiniteNumber
public static boolean isNonFiniteNumber(tools.jackson.databind.JsonNode node) Check if the node is a number and is one of NaN, Infinity or -Infinity- Parameters:
node- to check- Returns:
- true if it is NaN, Infinity or -Infinity
-