The sanity-clause Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The sanity-clause Reference Manual

This is the sanity-clause Reference Manual, version 0.7.0, generated automatically by Declt version 3.0 "Montgomery Scott" on Mon Dec 02 11:16:38 2019 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

.. image:: https://travis-ci.org/fisxoj/sanity-clause.svg?branch=master
   :target: https://travis-ci.org/fisxoj/sanity-clause
   :alt: Travis CI status badge
.. image:: https://coveralls.io/repos/github/fisxoj/sanity-clause/badge.svg?branch=master
   :target: https://coveralls.io/github/fisxoj/sanity-clause?branch=master
   :alt: Coveralls status badge
.. image:: https://img.shields.io/badge/Contributor%20Covenant-v1.4%20adopted-ff69b4.svg
   :alt: Contributor Covenant
   :target: CODE_OF_CONDUCT.md


:Source: `https://github.com/fisxoj/sanity-clause `_
:Docs:  `https://fisxoj.github.io/sanity-clause/ `_

..

  You can't fool me. There ain't no santy clause!

  -- Chico Marx


Sanity clause is a data validation/contract library.  You might use it for configuration data, validating an api response, or documents from a datastore.  In a dynamically typed language, it helps you define clearly defined areas of doubt and uncertainty.  We should love our users, but we should never blindly trust their inputs.

To make use of it, you define schemas, which can be property lists with keys and instances of :class:`sanity-clause.field:field` subclasses as values (eg. :class:`sanity-clause.field:integer-field`, :class:`sanity-clause.field:string-field`, &c.) or using the class-based interface via :class:`sanity-clause.schema:validated-metaclass`.  For example::

   (list :name (make-field :string) :age (make-field :integer))

You can load these sorts of schemas from a file by writing them as sexps with keywords, like this::

  schema.sexp

  (:key (:string :validator (:not-empty) :default "potato")
   :key2 (:integer :validator ((:int :min 0)) :default 2))

and then loading them using :function:`sanity-clause.loadable-schema:load-schema` to load them.


To use class-based schemas using :class:`sanity-clause:validated-metaclass` you can do things like::

   (defclass person ()
        ((favorite-dog :type symbol
                       :field-type :member
                       :members (:wedge :walter)
                       :required t)
         (age :type (integer 0)
              :required t)
         (potato :type string
                 :required t))
        (:metaclass sanity-clause:validated-metaclass))

which will validate their initargs when you instantiate them (**BUT NOT WHEN YOU SET SLOTS**).  Hopefully, that will be added eventually, perhaps as an optional feature.


~~~~~~~
Example
~~~~~~~

``v2-info.json``::

  {
    "title": "Swagger Sample App",
    "description": "This is a sample server Petstore server.",
    "termsOfService": "http://swagger.io/terms/",
    "contact": {
      "name": "API Support",
      "url": "http://www.swagger.io/support",
      "email": "support@swagger.io"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
    },
    "version": "1.0.1"
  }


``example.lisp``::

  ;; load required libraries
  (ql:quickload '(jonathan sanity-clause))

  (defclass contact-object ()
    ((name :type string
           :data-key "name"
           :documentation "The identifying name of the contact person/organization.")
     (url :type string
          :data-key "url"
          :field-type :uri
          :documentation "The URL pointing to the contact information. MUST be in the format of a URL.")
     (email :type string
            :data-key "email"
            :field-type :email
            :documentation "The email address of the contact person/organization. MUST be in the format of an email address."))
    (:metaclass sanity-clause:validated-metaclass))


  (defclass license-object ()
    ((name :type string
           :data-key "name"
           :documentation "The license name used for the API.")
     (url :type string
          :data-key "url"
          :field-type :uri
          :documentation "A URL to the license used for the API. MUST be in the format of a URL."))
    (:metaclass sanity-clause:validated-metaclass))


  (defclass info-object ()
    ((title :type string
            :data-key "title"
            :required t
            :documentation "The title of the application.")
     (description :type string
                  :data-key "description"
                  :documentation "A short description of the application. GFM syntax can be used for rich text representation.")
     (terms-of-service :type string
                       :data-key "termsOfService"
                       :documentation "The Terms of Service for the API.")
     (contact :type contact-object
              :field-type :nested
              :data-key "contact"
              :element-type contact-object
              :documentation "The contact information for the exposed API.")
     (license :type license-object
              :field-type :nested
              :element-type license-object
              :data-key "license"
              :documentation "The license information for the exposed API.")
     (version :type string
              :documentation "Provides the version of the application API (not to be confused with the specification version)."
              :data-key "version"
              :required t))
    (:metaclass sanity-clause:validated-metaclass))

  ;;; Deserialize the json from the file into instances of these classes

  (let ((v2-info (alexandria:read-file-into-string (merge-pathnames "v2-info.json" *load-truename*))))
    (sanity-clause:load 'info-object (jojo:parse v2-info :as :alist)))

  ;; => #

  (slot-value * 'license)

  ;; => #

  (slot-value * 'name)

  ;; => "Apache 2.0"


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 sanity-clause

Author

Matt Novenstern

Home Page

https://fisxoj.github.io/sanity-clause/

License

LGPLv3

Description

Sanity clause is a data contract and validation library.

Long Description

.. image:: https://travis-ci.org/fisxoj/sanity-clause.svg?branch=master
:target: https://travis-ci.org/fisxoj/sanity-clause
:alt: Travis CI status badge
.. image:: https://coveralls.io/repos/github/fisxoj/sanity-clause/badge.svg?branch=master
:target: https://coveralls.io/github/fisxoj/sanity-clause?branch=master
:alt: Coveralls status badge
.. image:: https://img.shields.io/badge/Contributor%20Covenant-v1.4%20adopted-ff69b4.svg
:alt: Contributor Covenant
:target: CODE_OF_CONDUCT.md

:Source: ‘https://github.com/fisxoj/sanity-clause <https://github.com/fisxoj/sanity-clause>‘_
:Docs: ‘https://fisxoj.github.io/sanity-clause/ <https://fisxoj.github.io/sanity-clause/>‘_

..

You can’t fool me. There ain’t no santy clause!

– Chico Marx

Sanity clause is a data validation/contract library. You might use it for configuration data, validating an api response, or documents from a datastore. In a dynamically typed language, it helps you define clearly defined areas of doubt and uncertainty. We should love our users, but we should never blindly trust their inputs.

To make use of it, you define schemas, which can be property lists with keys and instances of :class:‘sanity-clause.field:field‘ subclasses as values (eg. :class:‘sanity-clause.field:integer-field‘, :class:‘sanity-clause.field:string-field‘, &c.) or using the class-based interface via :class:‘sanity-clause.schema:validated-metaclass‘. For example::

(list :name (make-field :string) :age (make-field :integer))

You can load these sorts of schemas from a file by writing them as sexps with keywords, like this::

schema.sexp

(:key (:string :validator (:not-empty) :default "potato")
:key2 (:integer :validator ((:int :min 0)) :default 2))

and then loading them using :function:‘sanity-clause.loadable-schema:load-schema‘ to load them.

To use class-based schemas using :class:‘sanity-clause:validated-metaclass‘ you can do things like::

(defclass person ()
((favorite-dog :type symbol
:field-type :member
:members (:wedge :walter)
:required t)
(age :type (integer 0)
:required t)
(potato :type string
:required t))
(:metaclass sanity-clause:validated-metaclass))

which will validate their initargs when you instantiate them (**BUT NOT WHEN YOU SET SLOTS**). Hopefully, that will be added eventually, perhaps as an optional feature.

~~~~~~~
Example
~~~~~~~

“v2-info.json“::

{
"title": "Swagger Sample App",
"description": "This is a sample server Petstore server.",
"termsOfService": "http://swagger.io/terms/",
"contact": {
"name": "API Support",
"url": "http://www.swagger.io/support",
"email": "support@swagger.io"
},
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
},
"version": "1.0.1"
}

“example.lisp“::

;; load required libraries
(ql:quickload ’(jonathan sanity-clause))

(defclass contact-object ()
((name :type string
:data-key "name"
:documentation "The identifying name of the contact person/organization.")
(url :type string
:data-key "url"
:field-type :uri
:documentation "The URL pointing to the contact information. MUST be in the format of a URL.")
(email :type string
:data-key "email"
:field-type :email
:documentation "The email address of the contact person/organization. MUST be in the format of an email address."))
(:metaclass sanity-clause:validated-metaclass))

(defclass license-object ()
((name :type string
:data-key "name"
:documentation "The license name used for the API.")
(url :type string
:data-key "url"
:field-type :uri
:documentation "A URL to the license used for the API. MUST be in the format of a URL."))
(:metaclass sanity-clause:validated-metaclass))

(defclass info-object ()
((title :type string
:data-key "title"
:required t
:documentation "The title of the application.")
(description :type string
:data-key "description"
:documentation "A short description of the application. GFM syntax can be used for rich text representation.")
(terms-of-service :type string
:data-key "termsOfService"
:documentation "The Terms of Service for the API.")
(contact :type contact-object
:field-type :nested
:data-key "contact"
:element-type contact-object
:documentation "The contact information for the exposed API.")
(license :type license-object
:field-type :nested
:element-type license-object
:data-key "license"
:documentation "The license information for the exposed API.")
(version :type string
:documentation "Provides the version of the application API (not to be confused with the specification version)."
:data-key "version"
:required t))
(:metaclass sanity-clause:validated-metaclass))

;;; Deserialize the json from the file into instances of these classes

(let ((v2-info (alexandria:read-file-into-string (merge-pathnames "v2-info.json" *load-truename*))))
(sanity-clause:load ’info-object (jojo:parse v2-info :as :alist)))

;; => #<INFO-OBJECT {10045F9C93}>

(slot-value * ’license)

;; => #<LICENSE-OBJECT {1006600BE3}>

(slot-value * ’name)

;; => "Apache 2.0"

Version

0.7.0

Dependencies
Source

sanity-clause.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 sanity-clause.asd

Location

/home/quickref/quicklisp/dists/quicklisp/software/sanity-clause-20191130-git/sanity-clause.asd

Systems

sanity-clause (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.2 sanity-clause/util.lisp

Parent

sanity-clause (system)

Location

util.lisp

Packages

sanity-clause.util

Exported Definitions
Internal Definitions

lisp-name->env-name (function)


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.3 sanity-clause/validator.lisp

Parent

sanity-clause (system)

Location

validator.lisp

Packages

sanity-clause.validator

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.4 sanity-clause/protocol.lisp

Parent

sanity-clause (system)

Location

protocol.lisp

Packages

sanity-clause.protocol

Exported Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.5 sanity-clause/field.lisp

Parent

sanity-clause (system)

Location

field.lisp

Packages

sanity-clause.field

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.6 sanity-clause/loadable-schema.lisp

Parent

sanity-clause (system)

Location

loadable-schema.lisp

Packages

sanity-clause.loadable-schema

Exported Definitions

load-schema (function)


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.7 sanity-clause/schema.lisp

Parent

sanity-clause (system)

Location

schema.lisp

Packages

sanity-clause.schema

Exported Definitions
Internal Definitions

Previous: , Up: Lisp files   [Contents][Index]

3.1.8 sanity-clause/sanity-clause.lisp

Parent

sanity-clause (system)

Location

sanity-clause.lisp

Packages

sanity-clause


Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Next: , Previous: , Up: Packages   [Contents][Index]

4.1 sanity-clause.util

Source

util.lisp (file)

Use List
Exported Definitions
Internal Definitions

lisp-name->env-name (function)


Next: , Previous: , Up: Packages   [Contents][Index]

4.2 sanity-clause.validator

Some validation functions that can be used with fields to make sure data has certain properties.

Source

validator.lisp (file)

Use List
Exported Definitions
Internal Definitions

Next: , Previous: , Up: Packages   [Contents][Index]

4.3 sanity-clause.protocol

The methods that govern behavior in sanity-clause.

The methods relating to fields are:

* :function:‘resolve‘
* :function:‘deserialize‘
* :function:‘serialize‘
* :function:‘validate‘
* :function:‘get-value‘

The methods relating to schemas are:

* :function:‘load‘
* :function:‘dump‘

Source

protocol.lisp (file)

Use List

common-lisp

Used By List

sanity-clause

Exported Definitions

Next: , Previous: , Up: Packages   [Contents][Index]

4.4 sanity-clause.field

Field classes that can be used to validate data.

Also contains :function:‘sanity-clause.protocol:get-value‘, :function:‘sanity-clause.protocol:deserialize‘, and :function:‘sanity-clause.protocol:validate‘, which represent the lifecycle of loading data from some other object.

Source

field.lisp (file)

Use List
Exported Definitions
Internal Definitions

Next: , Previous: , Up: Packages   [Contents][Index]

4.5 sanity-clause.loadable-schema

Loadable schemas can be expressed as plists of keywords and then can be loaded by :function:‘load‘, either from a file, or a list.

You could, for example, define the configuration of a program that reads from the environment with::

(setq schema (sanity-clause.loadable-schema:load #P"my-schema.sexp"))

And then you could load it from the environment with::

(sanity-clause.schema:load schema :env)

your “my-schema.sexp“ might look like::

(:name (:string :validator (:not-empty) :default "lisa" :required t)
:age (:integer :validator ((:int :min 0)) :required t))

Source

loadable-schema.lisp (file)

Use List
Exported Definitions

load-schema (function)


Next: , Previous: , Up: Packages   [Contents][Index]

4.6 sanity-clause.schema

The :class:‘validated-metaclass‘ is a way of defining classes that have contracts enforced for them.

::

(defclass person ()
((favorite-dog :type symbol
:field-type :member
:members (:wedge :walter)
:data-key "favoriteDog"
:required t)
(age :type (integer 0)
:data-key "age"
:required t)
(potato :type string
:data-key "potato"
:required t))
(:metaclass validated-metaclass))

The above defines a class that can be instantiated with :function:‘sanity-clause.protocol:load, but will error if the initargs don’t satisfy the contract required by the field.

::

(sanity-clause:load ’person ’(("favoriteDog" . "wedge")
("age" . 10)
("potato" . "weasel"))

Some special types can be specifed with lisp type specs, like “age“ above, which will generate an :class:‘sanity-clause.field:integer-field‘, with validations requiring the value be at least 0.

**Nota Bene:** At the moment, there is no validation done on updating slots after instances are created and only instances created with :function:‘sanity-clause.protocol:load‘ are checked. Using :function:‘make-instance‘ doesn’t validate anything.

Source

schema.lisp (file)

Use List
Exported Definitions

validated-metaclass (class)

Internal Definitions

Previous: , Up: Packages   [Contents][Index]

4.7 sanity-clause

Main package of the :package:‘sanity-clause‘ system.

:package:‘sanity-clause‘ helps define data contracts like "this field will always have a valid integer greater than zero in it". It’s also useful for serializing and deserializing data to and from different formats. Contracts are built in the form of schemas, which are composed of :class:‘sanity-clause.field:field‘ s.

for example::

(setq schema (list :name (make-field ’string)
:age (make-field ’integer :validator (lambda (v) (unless (> v 0) "impossible age!")))))

(setq some-data ’((:name . "matt")
(:age . "7")))

(load schema some-data)
;; => (:name "matt" :age 7)
;; note: the string for age got converted by DESERIALIZE from a string to an integer.

To learn more about what fields exist, check out :package:‘sanity-clause.field‘.

To see more validation functions, check out :package:‘sanity-clause.validator‘.

To see how to load a schema from a file or keyword spec, check out :package:‘sanity-clause.schema‘.

Source

sanity-clause.lisp (file)

Use List

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Macros

Macro: do-key-values (KEY VALUE) DATA &body BODY
Package

sanity-clause.util

Source

util.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.2 Functions

Function: dump-field-p FIELD

Is this field required for serialization (fields that have flow of :dump or :both)?

Package

sanity-clause.field

Source

field.lisp (file)

Function: email VALUE

Checks that the input resembles an email.

Package

sanity-clause.validator

Source

validator.lisp (file)

Function: find-field TYPE

Find the class that corresponds to :param:‘type‘ by name

Package

sanity-clause.field

Source

field.lisp (file)

Function: get-value OBJECT KEY &optional DEFAULT

Generic reader function for lists and class instances. Returns a “(values value found-p)“ so you can tell if the value was in the list or not. Can also read from the environment if given “:env“ as OBJECT.

Package

sanity-clause.util

Source

util.lisp (file)

Function: hydrate-validators SPEC-PLIST

Takes a list of validators in the form of keywords and turns them into living function references.

Package

sanity-clause.validator

Source

validator.lisp (file)

Function: int VALUE &key RADIX MAX MIN

Accepts a :param:‘value‘ as an integer or string.
If :param:‘value‘ is a string, interpret it as a value with base- :param:‘radix‘. If specified, make sure :param:‘min‘ <= :param:‘value‘ <= :param:‘max‘.

Package

sanity-clause.validator

Source

validator.lisp (file)

Function: load-field-p FIELD

Is this field required for deserialization (fields that have flow of :load or :both)?

Package

sanity-clause.field

Source

field.lisp (file)

Function: load-schema SCHEMA

Takes a :type:‘pathname‘ or schema spec list like::

(:key (:string :validator (:not-empty) :default "potato") :key2 (:integer :validator ((:int :min 0)) :default 2))

and returns a schema plist with fields.

Package

sanity-clause.loadable-schema

Source

loadable-schema.lisp (file)

Function: make-field TYPE &rest ARGS

Make a field instance of class “type-FIELD“ and give it initargs :param:‘args‘.

Package

sanity-clause.field

Source

field.lisp (file)

Function: make-validator KEYWORD-SPEC

Find a validator function by keyword-spec and return the function represented by the spec.

Package

sanity-clause.validator

Source

validator.lisp (file)

Function: not-empty VALUE

Checks that some value has been supplied. Note: this won’t work well with boolean values because NIL is falsey.

Package

sanity-clause.validator

Source

validator.lisp (file)

Function: str VALUE &key MIN-LENGTH MAX-LENGTH

Checks that :param:‘value‘ is a string.
If specified, checks that :param:‘min-length‘ <= “(length value)“ <= :param:‘max-length‘.

Package

sanity-clause.validator

Source

validator.lisp (file)

Function: uuid VALUE

Checks that a value is a string that resembles a uuid.

Package

sanity-clause.validator

Source

validator.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.3 Generic functions

Generic Function: attribute-of OBJECT
Package

sanity-clause.field

Methods
Method: attribute-of (FIELD field)

Name of the attribute to write the field’s value to when serializing, if null, inferred from the name of the field.

Source

field.lisp (file)

Generic Function: data-key-of OBJECT
Generic Function: (setf data-key-of) NEW-VALUE OBJECT
Package

sanity-clause.field

Methods
Method: data-key-of (FIELD field)
Method: (setf data-key-of) NEW-VALUE (FIELD field)

Name of the attribute to read the field’s value from when deserializing, if null, inferred form the name of the field.

Source

field.lisp (file)

Generic Function: deserialize FIELD VALUE

Converts the value retrieved from the raw data into the datatype the field expects to work with, or fails, raising a :class:‘sanity-clause.field:conversion-error‘.

Package

sanity-clause.protocol

Source

protocol.lisp (file)

Methods
Method: deserialize (FIELD list-field) VALUE
Source

field.lisp (file)

Method: deserialize (FIELD nested-field) VALUE
Source

field.lisp (file)

Method: deserialize (FIELD timestamp-field) VALUE
Source

field.lisp (file)

Method: deserialize (FIELD real-field) VALUE
Source

field.lisp (file)

Method: deserialize (FIELD integer-field) VALUE
Source

field.lisp (file)

Method: deserialize (FIELD uri-field) VALUE
Source

field.lisp (file)

Method: deserialize (FIELD boolean-field) VALUE
Source

field.lisp (file)

Method: deserialize (FIELD member-field) VALUE
Source

field.lisp (file)

Method: deserialize (FIELD string-field) VALUE
Source

field.lisp (file)

Method: deserialize (FIELD field) VALUE
Source

field.lisp (file)

Method: deserialize (FIELD field) VALUE around
Source

field.lisp (file)

Generic Function: dump SCHEMA DATA &optional FORMAT

WARNING: This isn’t fully tested/supported, but it might work! I reserve the right to change the API in breaking ways, though.

dump takes some data an serializes it to a plist or alist based on :param:‘format‘, which can be set to, well, “:plist“ or “:alist“.

Package

sanity-clause.protocol

Source

protocol.lisp (file)

Methods
Method: dump (SCHEMA list) (DATA list) &optional FORMAT
Source

schema.lisp (file)

Method: dump (SCHEMA symbol) DATA &optional FORMAT
Source

schema.lisp (file)

Generic Function: error-messages-of CONDITION
Package

sanity-clause.field

Methods
Method: error-messages-of (CONDITION validation-error)
Source

field.lisp (file)

Generic Function: get-value FIELD OBJECT

Tries to fetch the value corresponding to the field from some datastructure. :param:‘field-name‘ is used if no attribute is explicitly set on the field.

Package

sanity-clause.protocol

Source

protocol.lisp (file)

Methods
Method: get-value (SLOT validated-slot-definition) OBJECT
Source

schema.lisp (file)

Method: get-value (FIELD constant-field) OBJECT
Source

field.lisp (file)

Method: get-value (FIELD field) OBJECT
Source

field.lisp (file)

Generic Function: load SCHEMA DATA &optional FORMAT

Deserializes :param:‘data‘ into an instance of :param:‘schema‘. Fills in default values and validates fields. If :param:‘schema‘ is “:env“, it will try to load from environment variables.

Package

sanity-clause.protocol

Source

protocol.lisp (file)

Methods
Method: load (CLASS validated-metaclass) DATA &optional FORMAT
Source

schema.lisp (file)

Method: load (SYMBOL symbol) DATA &optional FORMAT
Source

schema.lisp (file)

Method: load (SCHEMA list) DATA &optional FORMAT
Source

schema.lisp (file)

Generic Function: resolve FIELD DATA &optional PARENTS

A function that encapsulates getting, corecing, and validating values for a field. Calls :function:‘get-value‘, :function:‘deserialize‘, and :function:‘validate‘.

Package

sanity-clause.protocol

Source

protocol.lisp (file)

Methods
Method: resolve (FIELD one-schema-of-field) DATA &optional PARENTS
Source

field.lisp (file)

Method: resolve (FIELD one-field-of-field) DATA &optional PARENTS
Source

field.lisp (file)

Method: resolve (FIELD map-field) DATA &optional PARENTS
Source

field.lisp (file)

Method: resolve (FIELD field) DATA &optional PARENTS
Source

field.lisp (file)

Method: resolve (FIELD field) DATA &optional PARENTS around
Source

field.lisp (file)

Generic Function: serialize FIELD VALUE

Converts the value of a field into another representation.

Package

sanity-clause.protocol

Source

protocol.lisp (file)

Methods
Method: serialize (FIELD field) VALUE
Source

field.lisp (file)

Generic Function: validate FIELD VALUE

Run the validation checks for a given field and raise a :class:‘sanity-clause.field:validation-error‘ if it is invalid.

Package

sanity-clause.protocol

Source

protocol.lisp (file)

Methods
Method: validate (FIELD constant-field) VALUE
Source

field.lisp (file)

Method: validate (FIELD field) VALUE
Source

field.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.4 Conditions

Condition: conversion-error ()

An error that signals something went wrong while calling “converter“ for a field.

Package

sanity-clause.field

Source

field.lisp (file)

Direct superclasses
Direct methods
Direct slots
Slot: raised-error

The error that was caught while converting.

Initargs

:from-error

Readers

raised-error-of (generic function)

Condition: required-value-error ()

An error that signals a required value is missing.

Package

sanity-clause.field

Source

field.lisp (file)

Direct superclasses

field-error (condition)

Direct methods
Direct slots
Slot: missing-field-name

The name of the field that is missing a required value.

Initargs

:field-name

Readers

missing-field-name-of (generic function)

Condition: validation-error ()

Error that indicates a field is invalid.

Package

sanity-clause.field

Source

field.lisp (file)

Direct superclasses
Direct methods
Direct slots
Slot: error-messages

A list of any error messages generated by the a field.

Initargs

:error-messages

Initform

(quote nil)

Readers

error-messages-of (generic function)


Previous: , Up: Exported definitions   [Contents][Index]

5.1.5 Classes

Class: boolean-field ()

A field type for bolean values.

Package

sanity-clause.field

Source

field.lisp (file)

Direct superclasses

field (class)

Direct methods

deserialize (method)

Class: constant-field ()

A field that expects to get the same value every time. Will throw a :class:‘conversion-error‘ if VALUE isn’t equal to CONSTANT according to TEST.

Package

sanity-clause.field

Source

field.lisp (file)

Direct superclasses

field (class)

Direct methods
Direct slots
Slot: constant

The constant value to be serialized or deserialized.

Initargs

:constant

Readers

constant-value-of (generic function)

Slot: test

Function to use to compare the constant value to other values.

Initargs

:test

Initform

(quote equal)

Readers

constant-test-of (generic function)

Class: email-field ()

A field for values that should be emails.

Package

sanity-clause.field

Source

field.lisp (file)

Direct superclasses

string-field (class)

Direct slots
Slot: validator
Initform

(quote sanity-clause.validator:email)

Class: field ()

A base class for all fields that controls how they are (de?)serialized.

Package

sanity-clause.field

Source

field.lisp (file)

Direct superclasses

standard-object (class)

Direct subclasses
Direct methods
Direct slots
Slot: attribute

Name of the attribute to write the field’s value to when serializing, if null, inferred from the name of the field.

Type

(or null symbol string)

Initargs

:attribute

Readers

attribute-of (generic function)

Slot: data-key

Name of the attribute to read the field’s value from when deserializing, if null, inferred form the name of the field.

Type

(or null string symbol)

Initargs

:data-key

Readers

data-key-of (generic function)

Writers

(setf data-key-of) (generic function)

Slot: default

Value to use during serialization when no value is set.

Initargs

:default

Initform

:missing

Readers

default-of (generic function)

Slot: validator
Type

(or symbol function list)

Initargs

:validator

Initform

(constantly nil)

Readers

validator-of (generic function)

Slot: data-flow

If data should only ever be loaded into this field, this is :both (the default). If data should only be deserialized from the field and ignored when serializing, :load. If data should only be serialized from the field but ignored during loading, :dump.

Type

(member :both :load :dump)

Initargs

:flow

Initform

:both

Readers

data-flow-of (generic function)

Slot: required

Is this field required? Cause the field to fail validation if it’s not filled.

Type

boolean

Initargs

:required

Readers

required-p (generic function)

Class: integer-field ()

A field that holds an integer value.

Package

sanity-clause.field

Source

field.lisp (file)

Direct superclasses

field (class)

Direct methods

deserialize (method)

Direct slots
Slot: validator
Initform

(quote sanity-clause.validator:int)

Class: list-field ()

A field that contains a list of values satsified by another field.

Package

sanity-clause.field

Source

field.lisp (file)

Direct superclasses
Direct methods

deserialize (method)

Class: map-field ()

A field that maps values of one kind to values to another kind, like strings to strings, or numbers to objects. examples::

(make-field :map :key-field :string :value-field :integer)
(deserialize * ’(("potato" . 4) ("chimp" . 11)))

Package

sanity-clause.field

Source

field.lisp (file)

Direct superclasses

field (class)

Direct methods
Direct slots
Slot: key-field
Initargs

:key-field

Initform

:string

Readers

key-field-of (generic function)

Writers

(setf key-field-of) (generic function)

Slot: value-field
Initargs

:value-field

Initform

:string

Readers

value-field-of (generic function)

Writers

(setf value-field-of) (generic function)

Class: member-field ()

A field that expects a member of a set of symbols.

Package

sanity-clause.field

Source

field.lisp (file)

Direct superclasses

field (class)

Direct methods
Direct slots
Slot: members
Initargs

:members

Initform

(error "a member field requires a list of symbols that are acceptable members.")

Readers

members-of (generic function)

Class: nested-field ()

A field that represents a complex object located at this slot.

Package

sanity-clause.field

Source

field.lisp (file)

Direct superclasses
Direct methods

deserialize (method)

Class: one-field-of-field ()

A field type that allows any of the fields specified.

Package

sanity-clause.field

Source

field.lisp (file)

Direct superclasses

field (class)

Direct methods
Direct slots
Slot: field-choices

Fields that this field could decode to.

Type

list

Initargs

:field-choices

Initform

(error ":field-choices is required in one-field-of-field.")

Readers

field-choices-of (generic function)

Writers

(setf field-choices-of) (generic function)

Class: one-schema-of-field ()

A field type that allows any of the schemas specified.

Use the “:schema-choices“ initarg to provide a list of schema classes to try.

**Note**: If your schema choices are very lenient (ie. every field is not required), this field will likely behave in unexpected ways. That is, if you specify a list of classes that only have optional fields, sanity clause won’t be able to figure out which one to use and will probably return the missing value instead of valid data. You probably want at least one charactersitic field to be required.

Package

sanity-clause.field

Source

field.lisp (file)

Direct superclasses

field (class)

Direct methods
Direct slots
Slot: schema-choices

Fields that this field could decode to.

Type

list

Initargs

:schema-choices

Initform

(error ":schema-choices is required in one-schema-of-field.")

Readers

schema-choices-of (generic function)

Writers

(setf schema-choices-of) (generic function)

Class: real-field ()

A field that contains a real value (eg. possibly a float).

Package

sanity-clause.field

Source

field.lisp (file)

Direct superclasses

field (class)

Direct methods

deserialize (method)

Class: string-field ()

A field that contains a string.

Package

sanity-clause.field

Source

field.lisp (file)

Direct superclasses

field (class)

Direct subclasses
Direct methods

deserialize (method)

Class: timestamp-field ()

A field that contains a timestamp

Package

sanity-clause.field

Source

field.lisp (file)

Direct superclasses

field (class)

Direct methods

deserialize (method)

Class: uri-field ()

A field for values that should be emails.

Package

sanity-clause.field

Source

field.lisp (file)

Direct superclasses

string-field (class)

Direct methods

deserialize (method)

Class: uuid-field ()

A field for values that should resemble UUIDs.

Package

sanity-clause.field

Source

field.lisp (file)

Direct superclasses

string-field (class)

Direct slots
Slot: validator
Initform

(quote sanity-clause.validator:uuid)

Class: validated-metaclass ()
Package

sanity-clause.schema

Source

schema.lisp (file)

Direct superclasses

standard-class (class)

Direct methods
  • load (method)
  • compute-effective-slot-definition (method)
  • effective-slot-definition-class (method)
  • direct-slot-definition-class (method)
  • validate-superclass (method)
  • make-instance (method)

Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Macros

Macro: define-final-class NAME DIRECT-SUPERCLASSES DIRECT-SLOTS &rest OPTIONS

A macro for definining classes that are finalized after definition.

Package

sanity-clause.field

Source

field.lisp (file)

Macro: fail VALUE REASON &rest FORMAT-ARGS
Package

sanity-clause.validator

Source

validator.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.2 Functions

Function: all-validators FIELD

Returns a generator function that yields a validator function each call.

Package

sanity-clause.field

Source

field.lisp (file)

Function: bool VALUE

Attempts to convert :param:‘value‘ to a “t“ or “nil“ by comparing it to a list of stringy true or false values. Throws a :class:‘<validation-error>‘ if it can’t figure out if :param:‘value‘ is truthy or falsey.

Package

sanity-clause.validator

Source

validator.lisp (file)

Function: class-initargs CLASS

Collect the initargs for :param:‘class‘, which is either a class or a symbol naming a class.

Package

sanity-clause.schema

Source

schema.lisp (file)

Function: initargs-for-slot INITARGS

Collects arguments for and initializes a field and then returns it along with the cleaned up :param:‘initargs‘. This list can then be passed as the initargs to :class:‘validated-field-slot-definition‘.

Package

sanity-clause.schema

Source

schema.lisp (file)

Function: lisp-name->env-name LISP-NAME

Convert kebab case to upper snake case, e.g. “some-name => SOME_NAME“

Package

sanity-clause.util

Source

util.lisp (file)

Function: merge-plist KEYS LIST1 LIST2

Merge the keys :param:‘keys‘ on :param:‘list1‘ and :param:‘list2‘.

Package

sanity-clause.schema

Source

schema.lisp (file)

Function: slot-type-to-field-initargs TYPESPEC

Sometimes, it’s useful to try to infer the field type from a lisp type-spec. For example::

(integer 0 10)

should produce a field that expects integers “(<= 0 n 10)“.

In the event the type isn’t a simple type, assume it’s a class with metaclass :class:‘validated-metaclass‘ and try to use that instead.

Package

sanity-clause.schema

Source

schema.lisp (file)

Function: take-properties TAKE-LIST FROM

Takes keys from :param:‘take-list‘ from the provided plist :param:‘from‘.

Package

sanity-clause.schema

Source

schema.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.3 Generic functions

Generic Function: constant-test-of OBJECT
Package

sanity-clause.field

Methods
Method: constant-test-of (CONSTANT-FIELD constant-field)

Function to use to compare the constant value to other values.

Source

field.lisp (file)

Generic Function: constant-value-of OBJECT
Package

sanity-clause.field

Methods
Method: constant-value-of (CONSTANT-FIELD constant-field)

The constant value to be serialized or deserialized.

Source

field.lisp (file)

Generic Function: data-flow-of OBJECT
Package

sanity-clause.field

Methods
Method: data-flow-of (FIELD field)

If data should only ever be loaded into this field, this is :both (the default). If data should only be deserialized from the field and ignored when serializing, :load. If data should only be serialized from the field but ignored during loading, :dump.

Source

field.lisp (file)

Generic Function: default-of OBJECT
Package

sanity-clause.field

Methods
Method: default-of (FIELD field)

Value to use during serialization when no value is set.

Source

field.lisp (file)

Generic Function: element-type-of OBJECT
Package

sanity-clause.field

Methods
Method: element-type-of (NESTED-ELEMENT nested-element)

The field that respresents the elements of the list.

Source

field.lisp (file)

Generic Function: field-choices-of OBJECT
Generic Function: (setf field-choices-of) NEW-VALUE OBJECT
Package

sanity-clause.field

Methods
Method: field-choices-of (ONE-FIELD-OF-FIELD one-field-of-field)
Method: (setf field-choices-of) NEW-VALUE (ONE-FIELD-OF-FIELD one-field-of-field)

Fields that this field could decode to.

Source

field.lisp (file)

Generic Function: field-of CONDITION
Package

sanity-clause.field

Methods
Method: field-of (CONDITION field-error)
Source

field.lisp (file)

Generic Function: field-of OBJECT
Generic Function: (setf field-of) NEW-VALUE OBJECT
Package

sanity-clause.schema

Methods
Method: field-of (VALIDATED-SLOT-DEFINITION validated-slot-definition)

automatically generated reader method

Source

schema.lisp (file)

Method: (setf field-of) NEW-VALUE (VALIDATED-SLOT-DEFINITION validated-slot-definition)

automatically generated writer method

Source

schema.lisp (file)

Generic Function: key-field-of OBJECT
Generic Function: (setf key-field-of) NEW-VALUE OBJECT
Package

sanity-clause.field

Methods
Method: key-field-of (MAP-FIELD map-field)

automatically generated reader method

Source

field.lisp (file)

Method: (setf key-field-of) NEW-VALUE (MAP-FIELD map-field)

automatically generated writer method

Source

field.lisp (file)

Generic Function: members-of OBJECT
Package

sanity-clause.field

Methods
Method: members-of (MEMBER-FIELD member-field)

automatically generated reader method

Source

field.lisp (file)

Generic Function: missing-field-name-of CONDITION
Package

sanity-clause.field

Methods
Method: missing-field-name-of (CONDITION required-value-error)
Source

field.lisp (file)

Generic Function: parents-of CONDITION
Generic Function: (setf parents-of) NEW-VALUE CONDITION
Package

sanity-clause.field

Methods
Method: parents-of (CONDITION field-error)
Method: (setf parents-of) NEW-VALUE (CONDITION field-error)
Source

field.lisp (file)

Generic Function: raised-error-of CONDITION
Package

sanity-clause.field

Methods
Method: raised-error-of (CONDITION conversion-error)
Source

field.lisp (file)

Generic Function: required-p OBJECT
Package

sanity-clause.field

Methods
Method: required-p (FIELD field)

Is this field required? Cause the field to fail validation if it’s not filled.

Source

field.lisp (file)

Generic Function: schema-choices-of OBJECT
Generic Function: (setf schema-choices-of) NEW-VALUE OBJECT
Package

sanity-clause.field

Methods
Method: schema-choices-of (ONE-SCHEMA-OF-FIELD one-schema-of-field)
Method: (setf schema-choices-of) NEW-VALUE (ONE-SCHEMA-OF-FIELD one-schema-of-field)

Fields that this field could decode to.

Source

field.lisp (file)

Generic Function: validator-of OBJECT
Package

sanity-clause.field

Methods
Method: validator-of (FIELD field)

automatically generated reader method

Source

field.lisp (file)

Generic Function: value-field-of OBJECT
Generic Function: (setf value-field-of) NEW-VALUE OBJECT
Package

sanity-clause.field

Methods
Method: value-field-of (MAP-FIELD map-field)

automatically generated reader method

Source

field.lisp (file)

Method: (setf value-field-of) NEW-VALUE (MAP-FIELD map-field)

automatically generated writer method

Source

field.lisp (file)

Generic Function: value-of CONDITION
Package

sanity-clause.field

Methods
Method: value-of (CONDITION value-error)
Source

field.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.4 Conditions

Condition: field-error ()

Base class for all errors thrown by :package:‘sanity-clause.field‘.

Package

sanity-clause.field

Source

field.lisp (file)

Direct superclasses

error (condition)

Direct subclasses
Direct methods
Direct slots
Slot: field
Initargs

:field

Readers

field-of (generic function)

Slot: parents
Initargs

:parents

Readers

parents-of (generic function)

Writers

(setf parents-of) (generic function)

Condition: value-error ()

Base class for errors involving values.

Package

sanity-clause.field

Source

field.lisp (file)

Direct superclasses

error (condition)

Direct subclasses
Direct methods

value-of (method)

Direct slots
Slot: value

The value that failed validation.

Initargs

:value

Readers

value-of (generic function)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.5 Classes

Class: nested-element ()
Package

sanity-clause.field

Source

field.lisp (file)

Direct superclasses

standard-object (class)

Direct subclasses
Direct methods

element-type-of (method)

Direct slots
Slot: element-type

The field that respresents the elements of the list.

Type

(or sanity-clause.field:field symbol)

Initargs

:element-type

Initform

(error "a nested field requires an element-type to deserialize members to.")

Readers

element-type-of (generic function)

Class: validated-direct-slot-definition ()
Package

sanity-clause.schema

Source

schema.lisp (file)

Direct superclasses
Direct methods

shared-initialize (method)

Class: validated-effective-slot-definition ()
Package

sanity-clause.schema

Source

schema.lisp (file)

Direct superclasses
Class: validated-slot-definition ()
Package

sanity-clause.schema

Source

schema.lisp (file)

Direct superclasses

standard-object (class)

Direct subclasses
Direct methods
Direct slots
Slot: field
Type

sanity-clause.field:field

Initargs

:field-instance

Readers

field-of (generic function)

Writers

(setf field-of) (generic function)


Previous: , Up: Internal definitions   [Contents][Index]

5.2.6 Types

Type: missing ()
Package

sanity-clause.field

Source

field.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   L   S  
Index Entry  Section

F
File, Lisp, sanity-clause.asd: The sanity-clause․asd file
File, Lisp, sanity-clause/field.lisp: The sanity-clause/field․lisp file
File, Lisp, sanity-clause/loadable-schema.lisp: The sanity-clause/loadable-schema․lisp file
File, Lisp, sanity-clause/protocol.lisp: The sanity-clause/protocol․lisp file
File, Lisp, sanity-clause/sanity-clause.lisp: The sanity-clause/sanity-clause․lisp file
File, Lisp, sanity-clause/schema.lisp: The sanity-clause/schema․lisp file
File, Lisp, sanity-clause/util.lisp: The sanity-clause/util․lisp file
File, Lisp, sanity-clause/validator.lisp: The sanity-clause/validator․lisp file

L
Lisp File, sanity-clause.asd: The sanity-clause․asd file
Lisp File, sanity-clause/field.lisp: The sanity-clause/field․lisp file
Lisp File, sanity-clause/loadable-schema.lisp: The sanity-clause/loadable-schema․lisp file
Lisp File, sanity-clause/protocol.lisp: The sanity-clause/protocol․lisp file
Lisp File, sanity-clause/sanity-clause.lisp: The sanity-clause/sanity-clause․lisp file
Lisp File, sanity-clause/schema.lisp: The sanity-clause/schema․lisp file
Lisp File, sanity-clause/util.lisp: The sanity-clause/util․lisp file
Lisp File, sanity-clause/validator.lisp: The sanity-clause/validator․lisp file

S
sanity-clause.asd: The sanity-clause․asd file
sanity-clause/field.lisp: The sanity-clause/field․lisp file
sanity-clause/loadable-schema.lisp: The sanity-clause/loadable-schema․lisp file
sanity-clause/protocol.lisp: The sanity-clause/protocol․lisp file
sanity-clause/sanity-clause.lisp: The sanity-clause/sanity-clause․lisp file
sanity-clause/schema.lisp: The sanity-clause/schema․lisp file
sanity-clause/util.lisp: The sanity-clause/util․lisp file
sanity-clause/validator.lisp: The sanity-clause/validator․lisp file

Jump to:   F   L   S  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   (  
A   B   C   D   E   F   G   H   I   K   L   M   N   P   R   S   T   U   V  
Index Entry  Section

(
(setf data-key-of): Exported generic functions
(setf data-key-of): Exported generic functions
(setf field-choices-of): Internal generic functions
(setf field-choices-of): Internal generic functions
(setf field-of): Internal generic functions
(setf field-of): Internal generic functions
(setf key-field-of): Internal generic functions
(setf key-field-of): Internal generic functions
(setf parents-of): Internal generic functions
(setf parents-of): Internal generic functions
(setf schema-choices-of): Internal generic functions
(setf schema-choices-of): Internal generic functions
(setf value-field-of): Internal generic functions
(setf value-field-of): Internal generic functions

A
all-validators: Internal functions
attribute-of: Exported generic functions
attribute-of: Exported generic functions

B
bool: Internal functions

C
class-initargs: Internal functions
constant-test-of: Internal generic functions
constant-test-of: Internal generic functions
constant-value-of: Internal generic functions
constant-value-of: Internal generic functions

D
data-flow-of: Internal generic functions
data-flow-of: Internal generic functions
data-key-of: Exported generic functions
data-key-of: Exported generic functions
default-of: Internal generic functions
default-of: Internal generic functions
define-final-class: Internal macros
deserialize: Exported generic functions
deserialize: Exported generic functions
deserialize: Exported generic functions
deserialize: Exported generic functions
deserialize: Exported generic functions
deserialize: Exported generic functions
deserialize: Exported generic functions
deserialize: Exported generic functions
deserialize: Exported generic functions
deserialize: Exported generic functions
deserialize: Exported generic functions
deserialize: Exported generic functions
do-key-values: Exported macros
dump: Exported generic functions
dump: Exported generic functions
dump: Exported generic functions
dump-field-p: Exported functions

E
element-type-of: Internal generic functions
element-type-of: Internal generic functions
email: Exported functions
error-messages-of: Exported generic functions
error-messages-of: Exported generic functions

F
fail: Internal macros
field-choices-of: Internal generic functions
field-choices-of: Internal generic functions
field-of: Internal generic functions
field-of: Internal generic functions
field-of: Internal generic functions
field-of: Internal generic functions
find-field: Exported functions
Function, all-validators: Internal functions
Function, bool: Internal functions
Function, class-initargs: Internal functions
Function, dump-field-p: Exported functions
Function, email: Exported functions
Function, find-field: Exported functions
Function, get-value: Exported functions
Function, hydrate-validators: Exported functions
Function, initargs-for-slot: Internal functions
Function, int: Exported functions
Function, lisp-name->env-name: Internal functions
Function, load-field-p: Exported functions
Function, load-schema: Exported functions
Function, make-field: Exported functions
Function, make-validator: Exported functions
Function, merge-plist: Internal functions
Function, not-empty: Exported functions
Function, slot-type-to-field-initargs: Internal functions
Function, str: Exported functions
Function, take-properties: Internal functions
Function, uuid: Exported functions

G
Generic Function, (setf data-key-of): Exported generic functions
Generic Function, (setf field-choices-of): Internal generic functions
Generic Function, (setf field-of): Internal generic functions
Generic Function, (setf key-field-of): Internal generic functions
Generic Function, (setf parents-of): Internal generic functions
Generic Function, (setf schema-choices-of): Internal generic functions
Generic Function, (setf value-field-of): Internal generic functions
Generic Function, attribute-of: Exported generic functions
Generic Function, constant-test-of: Internal generic functions
Generic Function, constant-value-of: Internal generic functions
Generic Function, data-flow-of: Internal generic functions
Generic Function, data-key-of: Exported generic functions
Generic Function, default-of: Internal generic functions
Generic Function, deserialize: Exported generic functions
Generic Function, dump: Exported generic functions
Generic Function, element-type-of: Internal generic functions
Generic Function, error-messages-of: Exported generic functions
Generic Function, field-choices-of: Internal generic functions
Generic Function, field-of: Internal generic functions
Generic Function, field-of: Internal generic functions
Generic Function, get-value: Exported generic functions
Generic Function, key-field-of: Internal generic functions
Generic Function, load: Exported generic functions
Generic Function, members-of: Internal generic functions
Generic Function, missing-field-name-of: Internal generic functions
Generic Function, parents-of: Internal generic functions
Generic Function, raised-error-of: Internal generic functions
Generic Function, required-p: Internal generic functions
Generic Function, resolve: Exported generic functions
Generic Function, schema-choices-of: Internal generic functions
Generic Function, serialize: Exported generic functions
Generic Function, validate: Exported generic functions
Generic Function, validator-of: Internal generic functions
Generic Function, value-field-of: Internal generic functions
Generic Function, value-of: Internal generic functions
get-value: Exported functions
get-value: Exported generic functions
get-value: Exported generic functions
get-value: Exported generic functions
get-value: Exported generic functions

H
hydrate-validators: Exported functions

I
initargs-for-slot: Internal functions
int: Exported functions

K
key-field-of: Internal generic functions
key-field-of: Internal generic functions

L
lisp-name->env-name: Internal functions
load: Exported generic functions
load: Exported generic functions
load: Exported generic functions
load: Exported generic functions
load-field-p: Exported functions
load-schema: Exported functions

M
Macro, define-final-class: Internal macros
Macro, do-key-values: Exported macros
Macro, fail: Internal macros
make-field: Exported functions
make-validator: Exported functions
members-of: Internal generic functions
members-of: Internal generic functions
merge-plist: Internal functions
Method, (setf data-key-of): Exported generic functions
Method, (setf field-choices-of): Internal generic functions
Method, (setf field-of): Internal generic functions
Method, (setf key-field-of): Internal generic functions
Method, (setf parents-of): Internal generic functions
Method, (setf schema-choices-of): Internal generic functions
Method, (setf value-field-of): Internal generic functions
Method, attribute-of: Exported generic functions
Method, constant-test-of: Internal generic functions
Method, constant-value-of: Internal generic functions
Method, data-flow-of: Internal generic functions
Method, data-key-of: Exported generic functions
Method, default-of: Internal generic functions
Method, deserialize: Exported generic functions
Method, deserialize: Exported generic functions
Method, deserialize: Exported generic functions
Method, deserialize: Exported generic functions
Method, deserialize: Exported generic functions
Method, deserialize: Exported generic functions
Method, deserialize: Exported generic functions
Method, deserialize: Exported generic functions
Method, deserialize: Exported generic functions
Method, deserialize: Exported generic functions
Method, deserialize: Exported generic functions
Method, dump: Exported generic functions
Method, dump: Exported generic functions
Method, element-type-of: Internal generic functions
Method, error-messages-of: Exported generic functions
Method, field-choices-of: Internal generic functions
Method, field-of: Internal generic functions
Method, field-of: Internal generic functions
Method, get-value: Exported generic functions
Method, get-value: Exported generic functions
Method, get-value: Exported generic functions
Method, key-field-of: Internal generic functions
Method, load: Exported generic functions
Method, load: Exported generic functions
Method, load: Exported generic functions
Method, members-of: Internal generic functions
Method, missing-field-name-of: Internal generic functions
Method, parents-of: Internal generic functions
Method, raised-error-of: Internal generic functions
Method, required-p: Internal generic functions
Method, resolve: Exported generic functions
Method, resolve: Exported generic functions
Method, resolve: Exported generic functions
Method, resolve: Exported generic functions
Method, resolve: Exported generic functions
Method, schema-choices-of: Internal generic functions
Method, serialize: Exported generic functions
Method, validate: Exported generic functions
Method, validate: Exported generic functions
Method, validator-of: Internal generic functions
Method, value-field-of: Internal generic functions
Method, value-of: Internal generic functions
missing-field-name-of: Internal generic functions
missing-field-name-of: Internal generic functions

N
not-empty: Exported functions

P
parents-of: Internal generic functions
parents-of: Internal generic functions

R
raised-error-of: Internal generic functions
raised-error-of: Internal generic functions
required-p: Internal generic functions
required-p: Internal generic functions
resolve: Exported generic functions
resolve: Exported generic functions
resolve: Exported generic functions
resolve: Exported generic functions
resolve: Exported generic functions
resolve: Exported generic functions

S
schema-choices-of: Internal generic functions
schema-choices-of: Internal generic functions
serialize: Exported generic functions
serialize: Exported generic functions
slot-type-to-field-initargs: Internal functions
str: Exported functions

T
take-properties: Internal functions

U
uuid: Exported functions

V
validate: Exported generic functions
validate: Exported generic functions
validate: Exported generic functions
validator-of: Internal generic functions
validator-of: Internal generic functions
value-field-of: Internal generic functions
value-field-of: Internal generic functions
value-of: Internal generic functions
value-of: Internal generic functions

Jump to:   (  
A   B   C   D   E   F   G   H   I   K   L   M   N   P   R   S   T   U   V  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   A   C   D   E   F   K   M   P   R   S   T   V  
Index Entry  Section

A
attribute: Exported classes

C
constant: Exported classes

D
data-flow: Exported classes
data-key: Exported classes
default: Exported classes

E
element-type: Internal classes
error-messages: Exported conditions

F
field: Internal conditions
field: Internal classes
field-choices: Exported classes

K
key-field: Exported classes

M
members: Exported classes
missing-field-name: Exported conditions

P
parents: Internal conditions

R
raised-error: Exported conditions
required: Exported classes

S
schema-choices: Exported classes
Slot, attribute: Exported classes
Slot, constant: Exported classes
Slot, data-flow: Exported classes
Slot, data-key: Exported classes
Slot, default: Exported classes
Slot, element-type: Internal classes
Slot, error-messages: Exported conditions
Slot, field: Internal conditions
Slot, field: Internal classes
Slot, field-choices: Exported classes
Slot, key-field: Exported classes
Slot, members: Exported classes
Slot, missing-field-name: Exported conditions
Slot, parents: Internal conditions
Slot, raised-error: Exported conditions
Slot, required: Exported classes
Slot, schema-choices: Exported classes
Slot, test: Exported classes
Slot, validator: Exported classes
Slot, validator: Exported classes
Slot, validator: Exported classes
Slot, validator: Exported classes
Slot, value: Internal conditions
Slot, value-field: Exported classes

T
test: Exported classes

V
validator: Exported classes
validator: Exported classes
validator: Exported classes
validator: Exported classes
value: Internal conditions
value-field: Exported classes

Jump to:   A   C   D   E   F   K   M   P   R   S   T   V  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   B   C   E   F   I   L   M   N   O   P   R   S   T   U   V  
Index Entry  Section

B
boolean-field: Exported classes

C
Class, boolean-field: Exported classes
Class, constant-field: Exported classes
Class, email-field: Exported classes
Class, field: Exported classes
Class, integer-field: Exported classes
Class, list-field: Exported classes
Class, map-field: Exported classes
Class, member-field: Exported classes
Class, nested-element: Internal classes
Class, nested-field: Exported classes
Class, one-field-of-field: Exported classes
Class, one-schema-of-field: Exported classes
Class, real-field: Exported classes
Class, string-field: Exported classes
Class, timestamp-field: Exported classes
Class, uri-field: Exported classes
Class, uuid-field: Exported classes
Class, validated-direct-slot-definition: Internal classes
Class, validated-effective-slot-definition: Internal classes
Class, validated-metaclass: Exported classes
Class, validated-slot-definition: Internal classes
Condition, conversion-error: Exported conditions
Condition, field-error: Internal conditions
Condition, required-value-error: Exported conditions
Condition, validation-error: Exported conditions
Condition, value-error: Internal conditions
constant-field: Exported classes
conversion-error: Exported conditions

E
email-field: Exported classes

F
field: Exported classes
field-error: Internal conditions

I
integer-field: Exported classes

L
list-field: Exported classes

M
map-field: Exported classes
member-field: Exported classes
missing: Internal types

N
nested-element: Internal classes
nested-field: Exported classes

O
one-field-of-field: Exported classes
one-schema-of-field: Exported classes

P
Package, sanity-clause: The sanity-clause package
Package, sanity-clause.field: The sanity-clause․field package
Package, sanity-clause.loadable-schema: The sanity-clause․loadable-schema package
Package, sanity-clause.protocol: The sanity-clause․protocol package
Package, sanity-clause.schema: The sanity-clause․schema package
Package, sanity-clause.util: The sanity-clause․util package
Package, sanity-clause.validator: The sanity-clause․validator package

R
real-field: Exported classes
required-value-error: Exported conditions

S
sanity-clause: The sanity-clause system
sanity-clause: The sanity-clause package
sanity-clause.field: The sanity-clause․field package
sanity-clause.loadable-schema: The sanity-clause․loadable-schema package
sanity-clause.protocol: The sanity-clause․protocol package
sanity-clause.schema: The sanity-clause․schema package
sanity-clause.util: The sanity-clause․util package
sanity-clause.validator: The sanity-clause․validator package
string-field: Exported classes
System, sanity-clause: The sanity-clause system

T
timestamp-field: Exported classes
Type, missing: Internal types

U
uri-field: Exported classes
uuid-field: Exported classes

V
validated-direct-slot-definition: Internal classes
validated-effective-slot-definition: Internal classes
validated-metaclass: Exported classes
validated-slot-definition: Internal classes
validation-error: Exported conditions
value-error: Internal conditions

Jump to:   B   C   E   F   I   L   M   N   O   P   R   S   T   U   V