Liking cljdoc? Tell your friends :D

specomatic.registry

Functions and the macros that work with global clojure.spec registry to generate the specomatic schema.

Functions and the macros that work with global clojure.spec registry to generate the specomatic schema.
raw docstring

defentcljmacro

(defent etype & args)

Defines an entity. Takes the same arguments as s/keys and

  • :id to specify the id field for the entity (optional, default is :entity-type/id)
  • :field-ns for a namespace to use field specs from (optional, default is current namespace)

The entity name is added as a namespace to any unqualified keywords. If no spec exists for a field, but there is one for a keyword in the current namespace (overridden by :ns) and with the same name as the field, it is used for the field.

Defines an entity. Takes the same arguments as s/keys and
  * :id to specify the id field for the entity (optional, default is :entity-type/id)
  * :field-ns for a namespace to use field specs from (optional, default is current namespace)

The entity name is added as a namespace to any unqualified keywords.
If no spec exists for a field, but there is one for a keyword in the current namespace (overridden by :ns)
and with the same name as the field, it is used for the field.
sourceraw docstring

dispatchclj/s

(dispatch spec)

Given spec spec, returns the spec if it is a keyword, or a description thereof if it is not.

Given spec `spec`, returns the spec if it is a keyword, or a description thereof if it is not.
sourceraw docstring

etype-spec-form-fieldsclj/smultimethod

Returns the fields from an entity-defining spec form, preserving the order of the fields.

Returns the fields from an entity-defining spec form, preserving the order of the fields.
sourceraw docstring

etype-spec-form-required-fieldsclj/smultimethod

Returns the required fields from an entity-defining spec form as a set

Returns the required fields from an entity-defining spec form as a set
sourceraw docstring

etype-spec-form?clj/smultimethod

Checks if this spec form defines an entity type, extensible to every spec predicate function.

Checks if this spec form defines an entity type, extensible to every spec predicate function.
sourceraw docstring

field-defclj/s

(field-def spec)

Given spec spec, returns a map containing information about the spec: {:kind one of #{:simple :reference :reference-coll :part-coll} :dispatch the spec if it is a keyword or a description thereof if it is not. Used for dispatch :target the target entity type, only defined if type is #{:reference :reference-coll :part-coll}

Given spec `spec`, returns a map containing information about the spec:
{:kind              one of #{:simple :reference :reference-coll :part-coll}
 :dispatch          the spec if it is a keyword or a description thereof if it is not. Used for dispatch
 :target            the target entity type, only defined if type is #{:reference :reference-coll :part-coll}
sourceraw docstring

full-schemaclj/s

(full-schema namespaces)
(full-schema namespaces override)
(full-schema namespaces override only)

Returns the entity schema for the namespaces as a map of entities to their schema. Optionally restricted to a sequence of entities only. Specific entity and field definitions may by overridden by an override map in the same shape as the schema. Shape of result: {::my.namespace.entity {:field-defs map of fields to fields' specs :id-field id field for the entity :required-fields set of required fields} ::my.namespace.entity2 ... }

Returns the entity schema for the `namespaces` as a map of entities to their schema.
Optionally restricted to a sequence of entities `only`.
Specific entity and field definitions may by overridden by an `override` map in the same shape as the schema.
Shape of result:
{::my.namespace.entity  {:field-defs       map of fields to fields' specs
                         :id-field         id field for the entity
                         :required-fields  set of required fields}
::my.namespace.entity2 ... }
sourceraw docstring

reference-coll-spec-form-referenced-etypeclj/smultimethod

Returns the referenced entity type from the given reference spec collection form, extensible to every spec predicate function.

Returns the referenced entity type from the given reference spec collection form, extensible to every spec predicate function.
sourceraw docstring

reference-coll-spec-form?clj/smultimethod

Checks if this spec form defines a collection of references. Extensible to every spec predicate function.

Checks if this spec form defines a collection of references. Extensible to every spec predicate function.
sourceraw docstring

reference-entity-key?clj/smultimethod

Checks if the key refers to the entity part of a s/or reference spec.

Checks if the key refers to the entity part of a s/or reference spec.
sourceraw docstring

reference-id-key?clj/smultimethod

Checks if the key refers to the id part of a s/or reference spec.

Checks if the key refers to the id part of a s/or reference spec.
sourceraw docstring

reference-spec-form-referenced-etypeclj/smultimethod

Returns the referenced entity type from the given reference spec form, extensible to every spec predicate function.

Returns the referenced entity type from the given reference spec form, extensible to every spec predicate function.
sourceraw docstring

reference-spec-form?clj/smultimethod

Checks if this spec form defines a reference. Extensible to every spec predicate function.

Checks if this spec form defines a reference. Extensible to every spec predicate function.
sourceraw docstring

schemaclj/s

(schema namespaces)
(schema namespaces only)

Returns the entity schema for the namespaces as a map of entities to their schema. Optionally restricted to a sequence of entities only. Shape of result: {::my.namespace.entity {:field-defs map of fields to fields' specs :id-field id field for the entity :required-fields set of required fields} ::my.namespace.entity2 ... }

Returns the entity schema for the `namespaces` as a map of entities to their schema.
Optionally restricted to a sequence of entities `only`.
Shape of result:
{::my.namespace.entity  {:field-defs       map of fields to fields' specs
                         :id-field         id field for the entity
                         :required-fields  set of required fields}
::my.namespace.entity2 ... }
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close