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(io.swagger.models.Swagger api)
Build a new validator for the given API specification.
|
| Modifier and Type | Method and Description |
|---|---|
com.networknt.status.Status |
validate(Object value,
io.swagger.models.Model schema)
Validate the given value against the given model schema.
|
com.networknt.status.Status |
validate(Object value,
io.swagger.models.properties.Property schema)
Validate the given value against the given property schema.
|
com.networknt.status.Status |
validate(String value,
io.swagger.models.Model schema)
Validate the given value against the given model schema.
|
com.networknt.status.Status |
validate(String value,
io.swagger.models.properties.Property schema)
Validate the given value against the given property schema.
|
public SchemaValidator()
This will not perform any validation of $ref references that reference local definitions.
public SchemaValidator(io.swagger.models.Swagger api)
api - The API to build the validator for. If provided, is used to retrieve schema definitions
for use in references.public com.networknt.status.Status validate(Object value, io.swagger.models.properties.Property schema)
value - The value to validateschema - The property schema to validate the value againstpublic com.networknt.status.Status validate(Object value, io.swagger.models.Model schema)
value - The value to validateschema - The model schema to validate the value againstpublic com.networknt.status.Status validate(String value, io.swagger.models.properties.Property schema)
value - The value to validateschema - The property schema to validate the value againstpublic com.networknt.status.Status validate(String value, io.swagger.models.Model schema)
value - The value to validateschema - The model schema to validate the value againstCopyright © 2017. All rights reserved.