Compare commits

..

No commits in common. "a12e02c51bd00df71a8e282eac7d3446a6420551" and "df994f324004f6284c415da37c24c1d5f99c56aa" have entirely different histories.

View File

@ -44,8 +44,7 @@
:object-end-time :object-generator :object-icon :object-image :object-end-time :object-generator :object-icon :object-image
:object-in-reply-to :object-location :object-media-type :object-name :object-in-reply-to :object-location :object-media-type :object-name
:object-preview :object-published :object-replies :object-start-time :object-preview :object-published :object-replies :object-start-time
:object-summary :object-tag :object-to :object-type :object-updated :object-summary :object-tag :object-to :object-updated :object-url
:object-url
:ordered-collection-page-start-index :ordered-collection-page-start-index
:place-accuracy :place-altitude :place-latitude :place-longitude :place-accuracy :place-altitude :place-latitude :place-longitude
:place-radius :place-units :place-radius :place-units
@ -116,9 +115,13 @@ CLASSes slots with JSON keys based on the camel-cased slot name."
attachment attributed-to audience bcc bto cc content context attachment attributed-to audience bcc bto cc content context
duration end-time generator icon id image in-reply-to location duration end-time generator icon id image in-reply-to location
media-type name preview published replies start-time summary media-type name preview published replies start-time summary
tag to type updated url tag to 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:encode-object 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))
@ -205,15 +208,6 @@ 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)
@ -245,7 +239,3 @@ to us) removed."
(string (aref string 0)) (string (aref string 0))
(str:camel-case string)) (str:camel-case string))
(str:camel-case string))) (str:camel-case string)))
(defun class-pretty-name (class)
"Return a CLASSes name in a “pretty” (sentence-capitalized) string."
(string-capitalize (symbol-name (class-name class))))