Closed jfmcbrayer closed 3 years ago
You're right, it should. I ended up not using this for my own project, and it never occurred to me to test for this case.
I'm afraid I don't have much time to work on it at the moment and I can't promise I'll get to it soon, but you're welcome to give it a try. A good start might be to create a test case for inheritance. And feel free to ask any questions in the thread.
I'll give it a try, but as I said, I'm kind of a newbie. A test case is probably within my capabilities, though.
For reference, what did you end up using for your own project, assuming you still needed to generate JSON for CLOS objects?
Just defining the method yason:encode-slots
on the objects. That way the internal implementation of the classes won't depend on the external JSON representation or vice versa.
Ah, thanks. I will probably do that as well. But I guess I will still write you a failing test case for json-mop.
Hi. I'm kind of a CL newbie, but I'm trying to use json-mop and having an issue with inheritance.
Suppose I have two classes:
(encode (make-instance 'parent))
prints exactly what I expect:{"foo":"Foo"}
I would expect
(encode (make-instance 'child))
to print exactly the same thing. However, it prints{}
.But:
Maybe I'm misunderstanding a basic CLOS thing? Shouldn't encoding an instance of
child
include the values it gets fromparent
's initforms?