From b32e0bdbb02af402dfe9db50486ce0efde75203b Mon Sep 17 00:00:00 2001 From: Luis Pereira Date: Fri, 26 Dec 2025 11:08:11 +0000 Subject: [PATCH] fix: include http error code on json api format --- asteroid.lisp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/asteroid.lisp b/asteroid.lisp index 869f71c..288f678 100644 --- a/asteroid.lisp +++ b/asteroid.lisp @@ -39,7 +39,10 @@ (define-api-format json (data) "JSON API format for Radiance" (setf (header "Content-Type") "application/json") - (cl-json:encode-json-to-string data)) + (let ((status (gethash "status" data))) + (when (and status (boundp '*response*)) + (setf (return-code *response*) status)) + (cl-json:encode-json-to-string data))) ;; Set JSON as the default API format (setf *default-api-format* "json")