public class SchemaValidator extends Object
Supports validation of properties and request/response bodies, and supports schema references.
| Constructor and Description |
|---|
SchemaValidator()
Build a new validator with no API specification.
|
SchemaValidator(com.networknt.oas.model.OpenApi3 api)
Build a new validator for the given API specification.
|
| Modifier and Type | Method and Description |
|---|---|
com.networknt.status.Status |
validate(Object value,
com.fasterxml.jackson.databind.JsonNode schema)
Validate the given value against the given property schema.
|
public SchemaValidator()
This will not perform any validation of $ref references that reference local schemas.
public SchemaValidator(com.networknt.oas.model.OpenApi3 api)
api - The API to build the validator for. If provided, is used to retrieve schemas in components
for use in references.public com.networknt.status.Status validate(Object value, com.fasterxml.jackson.databind.JsonNode schema)
value - The value to validateschema - The property schema to validate the value againstCopyright © 2018. All rights reserved.