From a7dfdc052a931cc0cabfeb85151bcdad782f08c8 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 7 May 2022 17:06:25 +0200 Subject: Parse JSON from Jira response Parse the Jira response into a hash that we can interact with. Needed to do some finagling to get my "lib" submodule directory to be searched for systems. --- src/main.lisp | 6 ++---- src/package.lisp | 2 ++ wajir.asd | 27 +++++++++++++++++++++++---- 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/src/main.lisp b/src/main.lisp index 7f6973f..31814bb 100644 --- a/src/main.lisp +++ b/src/main.lisp @@ -12,7 +12,7 @@ :basic-auth-token "TOKEN")) (defun fetch-issues (jql &key basic-auth-token) - (multiple-value-bind (body code) + (jzon:parse (dex:post "https://example.atlassian.net/rest/api/3/search" :content (format nil "{ @@ -22,6 +22,4 @@ jql) :headers `((:content-type . "application/json") (:authorization - . ,(format nil "Basic ~A" basic-auth-token)))) - - body)) + . ,(format nil "Basic ~A" basic-auth-token)))))) diff --git a/src/package.lisp b/src/package.lisp index a340f86..c48ccba 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -1,4 +1,6 @@ (defpackage :wajir (:use :cl) + (:local-nicknames (:jzon :com.inuoe.jzon)) + (:export :main)) diff --git a/wajir.asd b/wajir.asd index 2ebed6e..f283ad1 100644 --- a/wajir.asd +++ b/wajir.asd @@ -1,6 +1,25 @@ -(asdf:defsystem wajir +; (push +; (merge-pathnames "lib/" (asdf:system-source-directory :wajir)) +; asdf:*central-registry*) + +(in-package :asdf-user) + +; (initialize-source-registry +; '(:source-registry +; (:tree (merge-pathnames "lib/" (system-source-directory :wajir))) +; :inherit-configuration)) + +(initialize-source-registry + `(:source-registry + (:tree ,(make-pathname :directory + (append + (pathname-directory *load-pathname*) + '("lib")))) + :inherit-configuration)) + +(defsystem wajir :version "0.0.1" - :depends-on (:cl-smtp + :depends-on (:com.inuoe.jzon :dexador) :components ((:module "src" :serial t @@ -12,5 +31,5 @@ :entry-point "wajir") #+sb-core-compression -(defmethod asdf:perform ((o asdf:image-op) (c asdf:system)) - (uiop:dump-image (asdf:output-file o c) :executable t :compression t)) +(defmethod perform ((o image-op) (c system)) + (uiop:dump-image (output-file o c) :executable t :compression t)) -- cgit v1.2.3