Use jzon instead of jonathan

This commit is contained in:
Akira Tempaku 2025-04-20 22:39:07 +09:00
parent 5448d575ad
commit 9a03693807
Signed by: paku
GPG key ID: 5B4E8402BCC50607
3 changed files with 11 additions and 7 deletions

2
qlfile
View file

@ -1,5 +1,5 @@
ql alexandria
ql dexador
ql jonathan
ql jzon
ql quri
ql kebab

View file

@ -10,10 +10,10 @@
(:class qlot/source/ql:source-ql
:initargs (:%version :latest)
:version "ql-2024-10-12"))
("jonathan" .
("jzon" .
(:class qlot/source/ql:source-ql
:initargs (:%version :latest)
:version "ql-2020-09-25"))
:version "ql-2024-10-12"))
("quri" .
(:class qlot/source/ql:source-ql
:initargs (:%version :latest)

View file

@ -3,9 +3,10 @@
(:use #:cl)
(:import-from #:alexandria
#:remove-from-plist
#:symbolicate)
(:import-from #:jonathan
#:to-json
#:symbolicate
#:plist-hash-table)
(:import-from #:com.inuoe.jzon
#:stringify
#:parse)
(:import-from #:dexador
#:request
@ -34,7 +35,7 @@
:method method
:headers `(("X-MICROCMS-API-KEY" . ,*api-key*)
("Content-Type" . "application/json"))
:content (and content (to-json content))
:content (%build-content content)
:force-binary nil)
(format t "microCMS status: ~D~%" status)
(when (and (stringp res-body)
@ -53,6 +54,9 @@
(loop :for (key val) :on query :by #'cddr
:collect (cons (to-camel-case (symbol-name key)) val)))
(defun %build-content (content)
(and content (stringify (plist-hash-table content))))
(defmacro define-list-client (endpoint)
(let ((str-endpoint (string-downcase (string endpoint))))
`(progn