Closed Deraen closed 9 years ago
In addition to json-type
method, other stuff should also be moved to protocol so that adding support for new type would only require extending the protocol.
(defprotocol ISwaggered []
(json-type [this])
; json: coerce from string
(coerce [this string])
(encode [this]) ; cheshire add-encoder?
; EDN tag read/parse?
; transit
)
Done.
While performance doesn't matter in this case, protocols would make sense because creating new schema types would be easier: