ring.swagger.schema
coerce
(coerce schema value)
(coerce schema value type)
Coerces a value against a schema using a given coerser. If no errors, returns the coerced value, otherwise returns ValidationError.
Optional third parameter is a dispatch value to ring.swagger.coerce/coercer, defaults to :json
coerce!
(coerce! schema value)
(coerce! schema value type)
Coerces a value against a schema using a given coerser. If no errors, returns the coerced value, otherwise throws a schema.utils.ErrorContainer enriched with :type ::validation.
Optional third parameter is a dispatch value to ring.swagger.coerce/coercer, defaults to :json
field
(field schema meta-data)
Attaches meta-data to a schema under :json-schema key. If the schema is of type which cannot have meta-data (e.g. Java Classes) schema is wrapped first into s/conditional Schema.