This project is read-only.

real basic Nancyfx question

Nov 13, 2014 at 2:07 AM
Edited Nov 13, 2014 at 2:28 AM
I'm finding it difficult to find good Nancy support about one particular item. I'm hoping you can help. It should be real simple. I'm just missing something. When I return a property that is a boolean, the value always returns as a string. So, my object has one property setup as "bool valid {get;set;}"

And if my code looks like:
        MyObject o = new MyObject();
        o.Vaild = true;

        return Response.AsJson(o);
the resulting JSON is always {"valid":"true"}. I want {"valid":true}. Is there a way to enforce data types? And if there is a better place for this question, I apologize.

Thoughts? Thanks.
Nov 13, 2014 at 6:35 AM
I think you should ask this question on the Nancy forum.
Marked as answer by dot_NET_Junkie on 4/4/2015 at 2:02 AM