Closed jduan closed 8 years ago
:undefined
as its nil sentinel. Automatically converting from :undefined
to nil
could be dangerous, if your intention was to serialize :undefined
in the first place. I know it's not ideal, but that's how it is. You need to tell riffed that you want your reason to be converted into a struct. You do this with the enumerize_struct
macro. There are some docs here: https://github.com/pinterest/riffed and
It'll look like this:
enumerize_struct ZooServer.Models.ErrorEntry, reason: ZooServer.Models.ErrorReason
# or, if you're already in the context of ZooServer.Models...
enumerize_struct ErrorEntry, reason: ErrorReason
@scohen thanks for your quick response. I fixed the code by doing the following:
Thanks again!
I've been playing with Riffed and I encountered a problem when writing tests.
My service is a simple CRUD service that allows clients to create, get, update, and delete animals. (think of the service as a zoo service)
In the test where I try to get an animal that doesn't exist, the assertion fails because of:
So there are two problems: