I'm trying to build a fn that generates a mock from a schema.
Once connected to the REPL in a Clojure project, I want to be able to generate a mock from a Plumatic schema. I'm using a lib that does that already and it's working. The only problem is it only works if I qualify the symbol with the project namespace. For instance, if the symbol-at-point is User which is in namespace contact.models, I need to concat these so that I pass "contact.models/User" to gen/generate.
Also, If I add the namespace by hand the eval works, but it does not print to the REPL. How do I do that?
(defun generate-mock ()
(interactive)
(let* ((sym (symbol-at-point))
(require-code "(require '[my-lib.generator :as gen])")
(generate (concat "(gen/generate " (symbol-name sym) ")")))
(cider-nrepl-sync-request:eval require-code)
(cider-nrepl-sync-request:eval generate)))