Web Development with Clojure, Third Edition: name confusing and missing fn/var page 218/219

@svmbrown

(json/read-value json/keyword-keys-object-mapper)

json/keyword-keys-object-mapper doesn’t exist

We’ve required cheshire.core’s generate-string and parse-string functions for working
with converting between JSON and EDN, and we’ve imported the classes for
which we’ll need to implement the IResultSetReadColumn and ISQLValue protocols.

Where is generate-string and parse-string used?

We’ve implemented IResultSetReadColumn for Array, returning a Clojure vector,
and for PGObjects of type JSON and JSONB, returning a Clojure map.

By json/read-value? Can you clarify?

Then, we’ve written a helper function to-pg-json to convert maps and vectors
to PGObjects. We use this function in our implementations of ISQLValue for IPersistentMap
and IPersistentVector to convert them into JSONB for use in queries.

Can you clarify to-pg-json as it’s not in the code? Did it mean write-pg-object and the extend-protocl right afterwards?

1 Like

I encountered the same issue and was able to fix it by updating my project.clj to use [metosin/muuntaja 0.6.8] instead of 0.6.7 (as instructed in the book).

It looks like that keyword-keys-object-mapper wasn’t a part of jsonista until its v0.3.5, which wasn’t a part of earlier muuntaja’s.

I cannot answer the rest of the issue, but it looks likely that the author hasn’t fully updated this section?

1 Like