(defclass map-location () ((lat :initarg :lat :accessor lat) (lon :initarg :lon :accessor lon) (zoom :initarg :zoom :accessor zoom))) (define-json-mapping map-location () (lat "lat") (lon "lon") (zoom "panoramio_zoom")) (defclass photo () ((width :initarg :width :reader width) (height :initarg :height :reader height))) (define-json-mapping photo () (width "width") (height "height")) (defclass response () ((has-more :initarg :has-more :reader has-more-p) (map-location :initarg :map-location :reader map-location) (photos :initarg :photos :reader photos))) (define-json-mapping response () (has-more "has_more" :type boolean) (map-location "map_location" :type (object map-location)) (photos "photos" :type (list (object photo)))) (defun test () (com.gigamonkeys.json:to-json (create-from-json '("has_more" :false "map_location" ("lat" 4.3 "lon" 12.3 "panoramio_zoom" "faraway") "photos" #(("width" 320 "height" 200) ("width" 640 "height" 480))) 'response)))