For some more flexibility, it would be neat to have another method encode whith the eql-specifier cl:null. This is also used in some other json parsers.
(defmethod encode ((object (eql 'cl:null)) &optional (stream *json-output*))
(write-string "null" stream)
object)
If you like the idea, I will submit the PR.