The sanity-clause Reference Manual

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

The sanity-clause Reference Manual

This is the sanity-clause Reference Manual, version 0.7.4, generated automatically by Declt version 4.0 beta 2 "William Riker" on Thu Sep 15 06:06:17 2022 GMT+0.

Table of Contents


1 Introduction

.. image:: https://github.com/fisxoj/sanity-clause/actions/workflows/test.yml/badge.svg
   :target: https://travis-ci.org/fisxoj/sanity-clause
   :alt: Github Actions 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"


2 Systems

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


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

2.1 sanity-clause

Sanity clause is a data contract and validation library.

Author

Matt Novenstern

Home Page

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

License

LGPLv3

Long Description

.. image:: https://github.com/fisxoj/sanity-clause/actions/workflows/test.yml/badge.svg
:target: https://travis-ci.org/fisxoj/sanity-clause
:alt: Github Actions 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.4

Dependencies
  • alexandria (system).
  • arrows (system).
  • cl-ppcre (system).
  • closer-mop (system).
  • local-time (system).
  • str (system).
  • trivial-types (system).
  • parse-float (system).
  • quri (system).
Source

sanity-clause.asd.

Child Components

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   [Contents][Index]

3.1.1 sanity-clause/sanity-clause.asd

Source

sanity-clause.asd.

Parent Component

sanity-clause (system).

ASDF Systems

sanity-clause.


3.1.2 sanity-clause/util.lisp

Source

sanity-clause.asd.

Parent Component

sanity-clause (system).

Packages

sanity-clause.util.

Public Interface
Internals

lisp-name->env-name (function).


3.1.3 sanity-clause/validator.lisp

Source

sanity-clause.asd.

Parent Component

sanity-clause (system).

Packages

sanity-clause.validator.

Public Interface
Internals

3.1.4 sanity-clause/protocol.lisp

Source

sanity-clause.asd.

Parent Component

sanity-clause (system).

Packages

sanity-clause.protocol.

Public Interface

3.1.5 sanity-clause/field.lisp

Source

sanity-clause.asd.

Parent Component

sanity-clause (system).

Packages

sanity-clause.field.

Public Interface
Internals

3.1.6 sanity-clause/loadable-schema.lisp

Source

sanity-clause.asd.

Parent Component

sanity-clause (system).

Packages

sanity-clause.loadable-schema.

Public Interface

load-schema (function).


3.1.7 sanity-clause/schema.lisp

Source

sanity-clause.asd.

Parent Component

sanity-clause (system).

Packages

sanity-clause.schema.

Public Interface
Internals

3.1.8 sanity-clause/sanity-clause.lisp

Source

sanity-clause.asd.

Parent Component

sanity-clause (system).

Packages

sanity-clause.


4 Packages

Packages are listed by definition order.


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

4.1 sanity-clause.validator

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

Source

validator.lisp.

Use List
  • alexandria.
  • arrows.
  • common-lisp.
Public Interface
Internals

4.2 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.

Use List
  • alexandria.
  • arrows.
  • common-lisp.
Public Interface
Internals

4.3 sanity-clause.util

Source

util.lisp.

Use List
  • alexandria.
  • arrows.
  • common-lisp.
Public Interface
Internals

lisp-name->env-name (function).


4.4 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.

Use List

4.5 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.

Use List
  • alexandria.
  • arrows.
  • common-lisp.
Public Interface

validated-metaclass (class).

Internals

4.6 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.

Use List
  • alexandria.
  • common-lisp.
Public Interface

load-schema (function).


4.7 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.

Use List

common-lisp.

Used By List

sanity-clause.

Public Interface

5 Definitions

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


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

5.1 Public Interface


5.1.1 Macros

Macro: do-key-values ((key value) data &body body)
Package

sanity-clause.util.

Source

util.lisp.


5.1.2 Ordinary 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.

Function: email (value)

Checks that the input resembles an email.

Package

sanity-clause.validator.

Source

validator.lisp.

Function: ensure-validator (keyword-spec)

Find a validator function by keyword-spec and return the function represented by the spec unless it’s already a function.

Package

sanity-clause.validator.

Source

validator.lisp.

Function: find-field (type)

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

Package

sanity-clause.field.

Source

field.lisp.

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.

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.

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.

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.

Function: load-schema (schema &key data-key-transformer)

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. The field names are transformed into the “:data-key“ for the field by the :param:‘data-key-transformer‘, which is helpful when reading strings from a config file and putting them into a plist keyed with symbols.

Package

sanity-clause.loadable-schema.

Source

loadable-schema.lisp.

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.

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.

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.

Function: uuid (value)

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

Package

sanity-clause.validator.

Source

validator.lisp.


5.1.3 Generic functions

Generic Reader: attribute-of (object)
Package

sanity-clause.field.

Methods
Reader 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.

Target Slot

attribute.

Generic Reader: data-key-of (object)
Generic Writer: (setf data-key-of) (object)
Package

sanity-clause.field.

Methods
Reader Method: data-key-of ((field field))
Writer Method: (setf data-key-of) ((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.

Target Slot

data-key.

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.

Methods
Method: deserialize ((field one-schema-of-field) data)
Source

field.lisp.

Method: deserialize ((field list-field) value)
Source

field.lisp.

Method: deserialize ((field nested-field) value)
Source

field.lisp.

Method: deserialize ((field timestamp-field) value)
Source

field.lisp.

Method: deserialize ((field real-field) value)
Source

field.lisp.

Method: deserialize ((field integer-field) value)
Source

field.lisp.

Method: deserialize ((field uri-field) value)
Source

field.lisp.

Method: deserialize ((field boolean-field) value)
Source

field.lisp.

Method: deserialize ((field member-field) value)
Source

field.lisp.

Method: deserialize ((field string-field) value)
Source

field.lisp.

Method: deserialize ((field field) value)
Source

field.lisp.

Method: deserialize :around ((field field) value)
Source

field.lisp.

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.

Methods
Method: dump ((schema list) (data list) &optional format)
Source

schema.lisp.

Method: dump ((schema symbol) data &optional format)
Source

schema.lisp.

Generic Reader: error-messages-of (condition)
Package

sanity-clause.field.

Methods
Reader Method: error-messages-of ((condition validation-error))
Source

field.lisp.

Target Slot

error-messages.

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.

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

schema.lisp.

Method: get-value ((field constant-field) object)
Source

field.lisp.

Method: get-value ((field field) object)
Source

field.lisp.

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.

Methods
Method: load ((class validated-metaclass) data &optional format)
Source

schema.lisp.

Method: load ((symbol symbol) data &optional format)
Source

schema.lisp.

Method: load ((schema list) data &optional format)
Source

schema.lisp.

Method: load ((field field) data &optional format)
Source

field.lisp.

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.

Methods
Method: resolve ((field one-field-of-field) data &optional parents)
Source

field.lisp.

Method: resolve ((field map-field) data &optional parents)
Source

field.lisp.

Method: resolve ((field field) data &optional parents)
Source

field.lisp.

Method: resolve :around ((field field) data &optional parents)
Source

field.lisp.

Generic Function: serialize (field value)

Converts the value of a field into another representation.

Package

sanity-clause.protocol.

Source

protocol.lisp.

Methods
Method: serialize ((field field) value)
Source

field.lisp.

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.

Methods
Method: validate ((field constant-field) value)
Source

field.lisp.

Method: validate ((field field) value)
Source

field.lisp.


5.1.4 Standalone methods

Method: compute-effective-slot-definition :around ((class validated-metaclass) name direct-slot-definitions)
Package

sb-mop.

Source

schema.lisp.

Method: direct-slot-definition-class ((class validated-metaclass) &key)
Package

sb-mop.

Source

schema.lisp.

Method: effective-slot-definition-class ((class validated-metaclass) &key)
Package

sb-mop.

Source

schema.lisp.

Method: initialize-instance :after ((field list-field) &key)
Source

field.lisp.

Method: initialize-instance :after ((field map-field) &key)
Source

field.lisp.

Method: initialize-instance :after ((field one-field-of-field) &key)
Source

field.lisp.

Method: make-instance :around ((class validated-metaclass) &rest initargs &key data)
Source

schema.lisp.

Method: print-object ((object field) stream)
Source

field.lisp.

Method: print-object ((condition validation-error) stream)
Source

field.lisp.

Method: print-object ((condition required-value-error) stream)
Source

field.lisp.

Method: print-object ((condition conversion-error) stream)
Source

field.lisp.

Method: shared-initialize :around ((slot validated-direct-slot-definition) slot-names &rest initargs &key &allow-other-keys)
Source

schema.lisp.

Method: validate-superclass ((mc validated-metaclass) (c standard-object))
Package

sb-mop.

Source

schema.lisp.


5.1.5 Conditions

Condition: conversion-error

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

Package

sanity-clause.field.

Source

field.lisp.

Direct superclasses
Direct methods
Direct slots
Slot: raised-error

The error that was caught while converting.

Initargs

:from-error

Readers

raised-error-of.

Writers

This slot is read-only.

Condition: required-value-error

An error that signals a required value is missing.

Package

sanity-clause.field.

Source

field.lisp.

Direct superclasses

field-error.

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.

Writers

This slot is read-only.

Condition: validation-error

Error that indicates a field is invalid.

Package

sanity-clause.field.

Source

field.lisp.

Direct superclasses
Direct methods
Direct slots
Slot: error-messages

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

Initform

(quote nil)

Initargs

:error-messages

Readers

error-messages-of.

Writers

This slot is read-only.


Previous: , Up: Public Interface   [Contents][Index]

5.1.6 Classes

Class: boolean-field

A field type for bolean values.

Package

sanity-clause.field.

Source

field.lisp.

Direct superclasses

field.

Direct methods

deserialize.

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.

Direct superclasses

field.

Direct methods
Direct slots
Slot: constant

The constant value to be serialized or deserialized.

Initargs

:constant

Readers

constant-value-of.

Writers

This slot is read-only.

Slot: test

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

Initform

(quote equal)

Initargs

:test

Readers

constant-test-of.

Writers

This slot is read-only.

Class: email-field

A field for values that should be emails.

Package

sanity-clause.field.

Source

field.lisp.

Direct superclasses

string-field.

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.

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.

Writers

This slot is read-only.

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.

Writers

(setf data-key-of).

Slot: default

Value to use during serialization when no value is set.

Initform

:missing

Initargs

:default

Readers

default-of.

Writers

This slot is read-only.

Slot: validator
Type

(or symbol function list)

Initform

(constantly nil)

Initargs

:validator

Readers

validator-of.

Writers

This slot is read-only.

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)

Initform

:both

Initargs

:flow

Readers

data-flow-of.

Writers

This slot is read-only.

Slot: required

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

Type

boolean

Initargs

:required

Readers

required-p.

Writers

This slot is read-only.

Class: integer-field

A field that holds an integer value.

Package

sanity-clause.field.

Source

field.lisp.

Direct superclasses

field.

Direct methods

deserialize.

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.

Direct superclasses
Direct methods
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.

Direct superclasses

field.

Direct methods
Direct slots
Slot: key-field
Initform

:string

Initargs

:key-field

Readers

key-field-of.

Writers

(setf key-field-of).

Slot: value-field
Initform

:string

Initargs

:value-field

Readers

value-field-of.

Writers

(setf value-field-of).

Class: member-field

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

Package

sanity-clause.field.

Source

field.lisp.

Direct superclasses

field.

Direct methods
Direct slots
Slot: members
Initform

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

Initargs

:members

Readers

members-of.

Writers

This slot is read-only.

Class: nested-field

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

Package

sanity-clause.field.

Source

field.lisp.

Direct superclasses
Direct methods

deserialize.

Class: one-field-of-field

A field type that allows any of the fields specified.

Package

sanity-clause.field.

Source

field.lisp.

Direct superclasses

field.

Direct methods
Direct slots
Slot: field-choices

Fields that this field could decode to.

Type

list

Initform

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

Initargs

:field-choices

Readers

field-choices-of.

Writers

(setf field-choices-of).

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.

Direct superclasses

field.

Direct methods
Direct slots
Slot: schema-choices

Fields that this field could decode to.

Type

list

Initform

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

Initargs

:schema-choices

Readers

schema-choices-of.

Writers

(setf schema-choices-of).

Class: real-field

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

Package

sanity-clause.field.

Source

field.lisp.

Direct superclasses

field.

Direct methods

deserialize.

Class: string-field

A field that contains a string.

Package

sanity-clause.field.

Source

field.lisp.

Direct superclasses

field.

Direct subclasses
Direct methods

deserialize.

Class: timestamp-field

A field that contains a timestamp

Package

sanity-clause.field.

Source

field.lisp.

Direct superclasses

field.

Direct methods

deserialize.

Class: uri-field

A field for values that should be emails.

Package

sanity-clause.field.

Source

field.lisp.

Direct superclasses

string-field.

Direct methods

deserialize.

Class: uuid-field

A field for values that should resemble UUIDs.

Package

sanity-clause.field.

Source

field.lisp.

Direct superclasses

string-field.

Direct slots
Slot: validator
Initform

(quote sanity-clause.validator:uuid)

Class: validated-metaclass
Package

sanity-clause.schema.

Source

schema.lisp.

Direct superclasses

standard-class.

Direct methods

5.2 Internals


Next: , Previous: , Up: Internals   [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.

Macro: fail (value reason &rest format-args)
Package

sanity-clause.validator.

Source

validator.lisp.


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

5.2.2 Ordinary functions

Function: all-validators (field)

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

Package

sanity-clause.field.

Source

field.lisp.

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.

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.

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.

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.

Function: merge-plist (keys list1 list2)

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

Package

sanity-clause.schema.

Source

schema.lisp.

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.

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.


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

5.2.3 Generic functions

Generic Reader: constant-test-of (object)
Package

sanity-clause.field.

Methods
Reader Method: constant-test-of ((constant-field constant-field))

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

Source

field.lisp.

Target Slot

test.

Generic Reader: constant-value-of (object)
Package

sanity-clause.field.

Methods
Reader Method: constant-value-of ((constant-field constant-field))

The constant value to be serialized or deserialized.

Source

field.lisp.

Target Slot

constant.

Generic Reader: data-flow-of (object)
Package

sanity-clause.field.

Methods
Reader 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.

Target Slot

data-flow.

Generic Reader: default-of (object)
Package

sanity-clause.field.

Methods
Reader Method: default-of ((field field))

Value to use during serialization when no value is set.

Source

field.lisp.

Target Slot

default.

Generic Reader: element-type-of (object)
Package

sanity-clause.field.

Methods
Reader Method: element-type-of ((nested-element nested-element))

The field that respresents the elements of the list.

Source

field.lisp.

Target Slot

element-type.

Generic Reader: field-choices-of (object)
Generic Writer: (setf field-choices-of) (object)
Package

sanity-clause.field.

Methods
Reader Method: field-choices-of ((one-field-of-field one-field-of-field))
Writer Method: (setf field-choices-of) ((one-field-of-field one-field-of-field))

Fields that this field could decode to.

Source

field.lisp.

Target Slot

field-choices.

Generic Reader: field-of (condition)
Package

sanity-clause.field.

Methods
Reader Method: field-of ((condition field-error))
Source

field.lisp.

Target Slot

field.

Generic Reader: field-of (object)
Package

sanity-clause.schema.

Methods
Reader Method: field-of ((validated-slot-definition validated-slot-definition))

automatically generated reader method

Source

schema.lisp.

Target Slot

field.

Generic Writer: (setf field-of) (object)
Package

sanity-clause.schema.

Methods
Writer Method: (setf field-of) ((validated-slot-definition validated-slot-definition))

automatically generated writer method

Source

schema.lisp.

Target Slot

field.

Generic Reader: key-field-of (object)
Package

sanity-clause.field.

Methods
Reader Method: key-field-of ((map-field map-field))

automatically generated reader method

Source

field.lisp.

Target Slot

key-field.

Generic Writer: (setf key-field-of) (object)
Package

sanity-clause.field.

Methods
Writer Method: (setf key-field-of) ((map-field map-field))

automatically generated writer method

Source

field.lisp.

Target Slot

key-field.

Generic Reader: members-of (object)
Package

sanity-clause.field.

Methods
Reader Method: members-of ((member-field member-field))

automatically generated reader method

Source

field.lisp.

Target Slot

members.

Generic Reader: missing-field-name-of (condition)
Package

sanity-clause.field.

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

field.lisp.

Target Slot

missing-field-name.

Generic Reader: parents-of (condition)
Generic Writer: (setf parents-of) (condition)
Package

sanity-clause.field.

Methods
Reader Method: parents-of ((condition field-error))
Writer Method: (setf parents-of) ((condition field-error))
Source

field.lisp.

Target Slot

parents.

Generic Reader: raised-error-of (condition)
Package

sanity-clause.field.

Methods
Reader Method: raised-error-of ((condition conversion-error))
Source

field.lisp.

Target Slot

raised-error.

Generic Reader: required-p (object)
Package

sanity-clause.field.

Methods
Reader Method: required-p ((field field))

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

Source

field.lisp.

Target Slot

required.

Generic Reader: schema-choices-of (object)
Generic Writer: (setf schema-choices-of) (object)
Package

sanity-clause.field.

Methods
Reader Method: schema-choices-of ((one-schema-of-field one-schema-of-field))
Writer Method: (setf schema-choices-of) ((one-schema-of-field one-schema-of-field))

Fields that this field could decode to.

Source

field.lisp.

Target Slot

schema-choices.

Generic Reader: validator-of (object)
Package

sanity-clause.field.

Methods
Reader Method: validator-of ((field field))

automatically generated reader method

Source

field.lisp.

Target Slot

validator.

Generic Reader: value-field-of (object)
Package

sanity-clause.field.

Methods
Reader Method: value-field-of ((map-field map-field))

automatically generated reader method

Source

field.lisp.

Target Slot

value-field.

Generic Writer: (setf value-field-of) (object)
Package

sanity-clause.field.

Methods
Writer Method: (setf value-field-of) ((map-field map-field))

automatically generated writer method

Source

field.lisp.

Target Slot

value-field.

Generic Reader: value-of (condition)
Package

sanity-clause.field.

Methods
Reader Method: value-of ((condition value-error))
Source

field.lisp.

Target Slot

value.


Next: , Previous: , Up: Internals   [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.

Direct superclasses

error.

Direct subclasses
Direct methods
Direct slots
Slot: field
Initargs

:field

Readers

field-of.

Writers

This slot is read-only.

Slot: parents
Initargs

:parents

Readers

parents-of.

Writers

(setf parents-of).

Condition: value-error

Base class for errors involving values.

Package

sanity-clause.field.

Source

field.lisp.

Direct superclasses

error.

Direct subclasses
Direct methods

value-of.

Direct slots
Slot: value

The value that failed validation.

Initargs

:value

Readers

value-of.

Writers

This slot is read-only.


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

5.2.5 Classes

Class: nested-element
Package

sanity-clause.field.

Source

field.lisp.

Direct subclasses
Direct methods

element-type-of.

Direct slots
Slot: element-type

The field that respresents the elements of the list.

Type

(or sanity-clause.field:field symbol trivial-types:proper-list)

Initform

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

Initargs

:element-type

Readers

element-type-of.

Writers

This slot is read-only.

Class: validated-direct-slot-definition
Package

sanity-clause.schema.

Source

schema.lisp.

Direct superclasses
Direct methods

shared-initialize.

Class: validated-effective-slot-definition
Package

sanity-clause.schema.

Source

schema.lisp.

Direct superclasses
Class: validated-slot-definition
Package

sanity-clause.schema.

Source

schema.lisp.

Direct subclasses
Direct methods
Direct slots
Slot: field
Type

sanity-clause.field:field

Initargs

:field-instance

Readers

field-of.

Writers

(setf field-of).


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

5.2.6 Types

Type: missing ()
Package

sanity-clause.field.

Source

field.lisp.


Appendix A Indexes


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

A.1 Concepts


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): Public generic functions
(setf data-key-of): Public generic functions
(setf field-choices-of): Private generic functions
(setf field-choices-of): Private generic functions
(setf field-of): Private generic functions
(setf field-of): Private generic functions
(setf key-field-of): Private generic functions
(setf key-field-of): Private generic functions
(setf parents-of): Private generic functions
(setf parents-of): Private generic functions
(setf schema-choices-of): Private generic functions
(setf schema-choices-of): Private generic functions
(setf value-field-of): Private generic functions
(setf value-field-of): Private generic functions

A
all-validators: Private ordinary functions
attribute-of: Public generic functions
attribute-of: Public generic functions

B
bool: Private ordinary functions

C
class-initargs: Private ordinary functions
compute-effective-slot-definition: Public standalone methods
constant-test-of: Private generic functions
constant-test-of: Private generic functions
constant-value-of: Private generic functions
constant-value-of: Private generic functions

D
data-flow-of: Private generic functions
data-flow-of: Private generic functions
data-key-of: Public generic functions
data-key-of: Public generic functions
default-of: Private generic functions
default-of: Private generic functions
define-final-class: Private macros
deserialize: Public generic functions
deserialize: Public generic functions
deserialize: Public generic functions
deserialize: Public generic functions
deserialize: Public generic functions
deserialize: Public generic functions
deserialize: Public generic functions
deserialize: Public generic functions
deserialize: Public generic functions
deserialize: Public generic functions
deserialize: Public generic functions
deserialize: Public generic functions
deserialize: Public generic functions
direct-slot-definition-class: Public standalone methods
do-key-values: Public macros
dump: Public generic functions
dump: Public generic functions
dump: Public generic functions
dump-field-p: Public ordinary functions

E
effective-slot-definition-class: Public standalone methods
element-type-of: Private generic functions
element-type-of: Private generic functions
email: Public ordinary functions
ensure-validator: Public ordinary functions
error-messages-of: Public generic functions
error-messages-of: Public generic functions

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

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

H
hydrate-validators: Public ordinary functions

I
initargs-for-slot: Private ordinary functions
initialize-instance: Public standalone methods
initialize-instance: Public standalone methods
initialize-instance: Public standalone methods
int: Public ordinary functions

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

L
lisp-name->env-name: Private ordinary functions
load: Public generic functions
load: Public generic functions
load: Public generic functions
load: Public generic functions
load: Public generic functions
load-field-p: Public ordinary functions
load-schema: Public ordinary functions

M
Macro, define-final-class: Private macros
Macro, do-key-values: Public macros
Macro, fail: Private macros
make-field: Public ordinary functions
make-instance: Public standalone methods
members-of: Private generic functions
members-of: Private generic functions
merge-plist: Private ordinary functions
Method, (setf data-key-of): Public generic functions
Method, (setf field-choices-of): Private generic functions
Method, (setf field-of): Private generic functions
Method, (setf key-field-of): Private generic functions
Method, (setf parents-of): Private generic functions
Method, (setf schema-choices-of): Private generic functions
Method, (setf value-field-of): Private generic functions
Method, attribute-of: Public generic functions
Method, compute-effective-slot-definition: Public standalone methods
Method, constant-test-of: Private generic functions
Method, constant-value-of: Private generic functions
Method, data-flow-of: Private generic functions
Method, data-key-of: Public generic functions
Method, default-of: Private generic functions
Method, deserialize: Public generic functions
Method, deserialize: Public generic functions
Method, deserialize: Public generic functions
Method, deserialize: Public generic functions
Method, deserialize: Public generic functions
Method, deserialize: Public generic functions
Method, deserialize: Public generic functions
Method, deserialize: Public generic functions
Method, deserialize: Public generic functions
Method, deserialize: Public generic functions
Method, deserialize: Public generic functions
Method, deserialize: Public generic functions
Method, direct-slot-definition-class: Public standalone methods
Method, dump: Public generic functions
Method, dump: Public generic functions
Method, effective-slot-definition-class: Public standalone methods
Method, element-type-of: Private generic functions
Method, error-messages-of: Public generic functions
Method, field-choices-of: Private generic functions
Method, field-of: Private generic functions
Method, field-of: Private generic functions
Method, get-value: Public generic functions
Method, get-value: Public generic functions
Method, get-value: Public generic functions
Method, initialize-instance: Public standalone methods
Method, initialize-instance: Public standalone methods
Method, initialize-instance: Public standalone methods
Method, key-field-of: Private generic functions
Method, load: Public generic functions
Method, load: Public generic functions
Method, load: Public generic functions
Method, load: Public generic functions
Method, make-instance: Public standalone methods
Method, members-of: Private generic functions
Method, missing-field-name-of: Private generic functions
Method, parents-of: Private generic functions
Method, print-object: Public standalone methods
Method, print-object: Public standalone methods
Method, print-object: Public standalone methods
Method, print-object: Public standalone methods
Method, raised-error-of: Private generic functions
Method, required-p: Private generic functions
Method, resolve: Public generic functions
Method, resolve: Public generic functions
Method, resolve: Public generic functions
Method, resolve: Public generic functions
Method, schema-choices-of: Private generic functions
Method, serialize: Public generic functions
Method, shared-initialize: Public standalone methods
Method, validate: Public generic functions
Method, validate: Public generic functions
Method, validate-superclass: Public standalone methods
Method, validator-of: Private generic functions
Method, value-field-of: Private generic functions
Method, value-of: Private generic functions
missing-field-name-of: Private generic functions
missing-field-name-of: Private generic functions

N
not-empty: Public ordinary functions

P
parents-of: Private generic functions
parents-of: Private generic functions
print-object: Public standalone methods
print-object: Public standalone methods
print-object: Public standalone methods
print-object: Public standalone methods

R
raised-error-of: Private generic functions
raised-error-of: Private generic functions
required-p: Private generic functions
required-p: Private generic functions
resolve: Public generic functions
resolve: Public generic functions
resolve: Public generic functions
resolve: Public generic functions
resolve: Public generic functions

S
schema-choices-of: Private generic functions
schema-choices-of: Private generic functions
serialize: Public generic functions
serialize: Public generic functions
shared-initialize: Public standalone methods
slot-type-to-field-initargs: Private ordinary functions
str: Public ordinary functions

T
take-properties: Private ordinary functions

U
uuid: Public ordinary functions

V
validate: Public generic functions
validate: Public generic functions
validate: Public generic functions
validate-superclass: Public standalone methods
validator-of: Private generic functions
validator-of: Private generic functions
value-field-of: Private generic functions
value-field-of: Private generic functions
value-of: Private generic functions
value-of: Private 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: Public classes

C
constant: Public classes

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

E
element-type: Private classes
error-messages: Public conditions

F
field: Private conditions
field: Private classes
field-choices: Public classes

K
key-field: Public classes

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

P
parents: Private conditions

R
raised-error: Public conditions
required: Public classes

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

T
test: Public classes

V
validator: Public classes
validator: Public classes
validator: Public classes
validator: Public classes
value: Private conditions
value-field: Public 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: Public classes

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

E
email-field: Public classes

F
field: Public classes
field-error: Private conditions
field.lisp: The sanity-clause/field․lisp file
File, field.lisp: The sanity-clause/field․lisp file
File, loadable-schema.lisp: The sanity-clause/loadable-schema․lisp file
File, protocol.lisp: The sanity-clause/protocol․lisp file
File, sanity-clause.asd: The sanity-clause/sanity-clause․asd file
File, sanity-clause.lisp: The sanity-clause/sanity-clause․lisp file
File, schema.lisp: The sanity-clause/schema․lisp file
File, util.lisp: The sanity-clause/util․lisp file
File, validator.lisp: The sanity-clause/validator․lisp file

I
integer-field: Public classes

L
list-field: Public classes
loadable-schema.lisp: The sanity-clause/loadable-schema․lisp file

M
map-field: Public classes
member-field: Public classes
missing: Private types

N
nested-element: Private classes
nested-field: Public classes

O
one-field-of-field: Public classes
one-schema-of-field: Public 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
protocol.lisp: The sanity-clause/protocol․lisp file

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

S
sanity-clause: The sanity-clause system
sanity-clause: The sanity-clause package
sanity-clause.asd: The sanity-clause/sanity-clause․asd file
sanity-clause.field: The sanity-clause․field package
sanity-clause.lisp: The sanity-clause/sanity-clause․lisp file
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
schema.lisp: The sanity-clause/schema․lisp file
string-field: Public classes
System, sanity-clause: The sanity-clause system

T
timestamp-field: Public classes
Type, missing: Private types

U
uri-field: Public classes
util.lisp: The sanity-clause/util․lisp file
uuid-field: Public classes

V
validated-direct-slot-definition: Private classes
validated-effective-slot-definition: Private classes
validated-metaclass: Public classes
validated-slot-definition: Private classes
validation-error: Public conditions
validator.lisp: The sanity-clause/validator․lisp file
value-error: Private conditions

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