Liking cljdoc? Tell your friends :D

jsonapi.core


->attribute-objectclj/s

(->attribute-object resource-name id-key object)
source

decorate-requestclj/s

(decorate-request resource-name object)
(decorate-request resource-name object id-key)

Decorates a given object as a JSON API request. Adds an attributes objects and id attribute if id-key is provided.

Decorates a given `object` as a JSON API request. Adds an attributes objects and `id`
attribute if `id-key` is provided.
sourceraw docstring

decorate-responseclj/s

(decorate-response response)
(decorate-response response {:keys [jsonapi] :or {jsonapi {:version "1.0"}}})

Decorates a Ring response as JSON API response. It expects following keys in the given response:

Decorates a Ring response as JSON API response. It expects following keys
in the given response:
- `:jsonapi.core/resource-name` defines a `type` attribute of a response
https://jsonapi.org/format/#document-resource-object-identification
- `:jsonapi.core/id-key` defines a key name for an `id` attribute of an response
https://jsonapi.org/format/#document-resource-object-identification
- `:jsonapi.core/meta` an optional meta object https://jsonapi.org/format/#document-meta
- `:jsonapi.core/links` a links object https://jsonapi.org/format/#document-links
sourceraw docstring

id->strclj/smultimethod

source

strip-bodyclj/s

(strip-body {:keys [data] :as body})
source

strip-responseclj/s

(strip-response response)

Converts JSON API response to a simple object with an attributes and in ID.

Converts JSON API response to a simple object with an attributes and in ID.
sourceraw docstring

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

× close