Liking cljdoc? Tell your friends :D

pedestal-api-helper.params-helper


extract-field-valueclj

(extract-field-value field body)

extract field value, by converting string into other objects, uuid is the only conversion so far <br>

  • field ^ks: ks (field) to be extracted from body
  • body ^map: the body map where key-values will be extracted
extract field value, by converting string into other objects, uuid is the only conversion so far <br>
- *field* ^ks: ks (field) to be extracted from *body*
- *body* ^map: the body map where key-values will be extracted
sourceraw docstring

is-uuidclj

(is-uuid id)
source

mop-fieldsclj

(mop-fields body fields)

mop fields, removing unwanted key-values <br>

  • body ^map: the body map where key-values will be checked and/or removed
  • fields ^coll: ["field-0-name","field-n-name"] => accepted fields, the other ones will be removed
mop fields, removing unwanted key-values <br>
- *body* ^map: the body map where key-values will be checked and/or removed
- *fields* ^coll: ["field-0-name","field-n-name"] => accepted fields, the other ones will be removed
sourceraw docstring

uuidclj

(uuid)
source

uuid-as-stringclj

(uuid-as-string uuid)
source

uuid-patternclj

source

validate-and-mop!!clj

(validate-and-mop!! body to-validate accepted)
(validate-and-mop!! body to-validate accepted field-message)

validates fields and mop then, removing unwanted key-values <br>

  • body ^map: the body map where key-values will be checked and/or removed
  • to-validate ^map: {"field-name" [{:validate/type :validate/mandatory & :validate/message "%s is ..."},

<br> {:validate/type :validate/min, :validate/value 12 & :validate/message "% is mandatory"}, <br> {:validate/type :validate/max, :validate/value 40 & :validate/message "% is ..."}, <br> {:validate/type :validate/regex, :validate/value #"^[\d]{1,2}$" & :validate/message "% is ..."}, <br> {:validate/type :validate/custom, :validate/value fn & :validate/message "% is ..."}]} - *to-validate* ^coll: ["field-0-name","field-n-name"] => validates only mandatoryness. - *accepted* ^coll: ["field-0-name","field-n-name"] => accepted fields, the other ones will be removed - & *field-message* ^string: Default field message, is used just if to-validate is coll

validates fields and mop then, removing unwanted key-values <br>
- *body* ^map: the body map where key-values will be checked and/or removed
- *to-validate* ^map: {"field-name"
[{:validate/type :validate/mandatory & :validate/message "%s is ..."},
<br>
{:validate/type :validate/min, :validate/value 12 & :validate/message "% is mandatory"},
<br>
{:validate/type :validate/max, :validate/value 40 & :validate/message "% is ..."},
<br>
{:validate/type :validate/regex, :validate/value #"^[\d]{1,2}$" & :validate/message "% is ..."},
<br>
{:validate/type :validate/custom, :validate/value fn & :validate/message "% is ..."}]}
- *to-validate* ^coll: ["field-0-name","field-n-name"] => validates only mandatoryness.
- *accepted* ^coll: ["field-0-name","field-n-name"] => accepted fields, the other ones will be removed
- & *field-message* ^string: Default field message, is used just if to-validate is coll
sourceraw docstring

validate-mandatoryclj

(validate-mandatory body fields)
(validate-mandatory body fields message-untranslated)

validates mandatory fields <br>

  • body ^map: the body map where key-values will be checked and/or removed
  • fields ^coll: ["field-0-name","field-n-name"]
  • & field-message ^string: Default field message
validates mandatory fields <br>
- *body* ^map: the body map where key-values will be checked and/or removed
- *fields* ^coll: ["field-0-name","field-n-name"]
- & *field-message* ^string: Default field message
sourceraw docstring

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

× close