Ring-swagger Api Documentation

Version: 0.22.3

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

describe

(describe schema desc & kvs)

Attach description and possibly other meta-data to a schema.

error?

(error? x)

Checks whether input is an Schema error.

extract-schema-name

(extract-schema-name x)

Returns model name or nil

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.

named-schema?

(named-schema? x)

Checks whether input is a named schema.