I have a case where I have two routes that will return different formatted json for the same model. In one case, I want to include null values, in the other case, no.
My solution for this was to create a second JsonSerializer and call it directly in the NancyModule, but I am losing flexibility in the negotiations. What I would like to do is associate this with the Agreement for something like this:
return Negotiate
.WithStatusCode(HttpStatusCode.OK)
.WithModel( MyModel)
**.WithSerializer( MyCustomerJsonSerializer)**
.WithView("MyView");
source
share