Re-organization, no functional change

This commit is contained in:
Jaidyn Ann 2024-06-16 22:52:11 -05:00
parent b6582e2537
commit a12e02c51b

View File

@ -119,15 +119,6 @@ CLASSes slots with JSON keys based on the camel-cased slot name."
tag to type updated url tag to type updated url
(@context :initform "https://www.w3.org/ns/activitystreams"))) (@context :initform "https://www.w3.org/ns/activitystreams")))
(defmethod yason:encode ((obj object) &optional (stream *standard-output*))
(yason:with-output (stream)
(yason:with-object ()
(yason:encode-object obj)
(yason:encode-object-element
"type"
(or (object-type obj)
(class-pretty-name (class-of obj)))))))
;; https://www.w3.org/ns/activitystreams#Link ;; https://www.w3.org/ns/activitystreams#Link
(defclass-w-accessors link () (defclass-w-accessors link ()
(height href hreflang media-type name preview rel width)) (height href hreflang media-type name preview rel width))
@ -214,6 +205,15 @@ CLASSes slots with JSON keys based on the camel-cased slot name."
;;; JSON serialization ;;; JSON serialization
;;; ———————————————————————————————————————— ;;; ————————————————————————————————————————
(defmethod yason:encode ((obj object) &optional (stream *standard-output*))
(yason:with-output (stream)
(yason:with-object ()
(yason:encode-object obj)
(yason:encode-object-element
"type"
(or (object-type obj)
(class-pretty-name (class-of obj)))))))
;; Ensure all classes have their slots encodings defined with YASON. ;; Ensure all classes have their slots encodings defined with YASON.
(mapcar (lambda (class) (mapcar (lambda (class)
(closer-mop:finalize-inheritance class) (closer-mop:finalize-inheritance class)