Version - 0.2.0.0 (nuget)
When serialising an array or enumerable, I get the following formatted output:
{
"products":{
"id":"NOIDCOMPUTABLE!",
"length":3,
"longLength":3,
"rank":1,
"isReadOnly":false,
"isFixedSize":true,
"isSynchronized":false,
"links":{
"syncRoot":"NOIDCOMPUTABLE!"
}
}The class being serialised is:
[JsonObject(Title="product")]publicclassProductDto{publicintId{get;privateset;}publicstringName{get;privateset;}publicProductDto(intid,stringname){Id=id;Name=name;}publicoverridestringToString(){returnstring.Format("ProductDto [Id: {0}, Name: {1}]",Id,Name);}}If I serialise one of these (instead of an array) I get the expected output:
{"products":{"id":"1","name":"bob"}}This is running in a Web Api 2 project, with the following setup code in WebApiConfig.cs:
usingJSONAPI.EntityFramework;// For pluralisation service.usingJSONAPI.Json;// ...varformatter=newJsonApiFormatter{PluralizationService=newPluralizationService()};config.Formatters.Add(formatter);Is there anything I am missing here? I've searched other open issues (and Stackoverflow) but couldn't see this mentioned anywhere.
Thanks.
Version - 0.2.0.0 (nuget)
When serialising an array or enumerable, I get the following formatted output:
{ "products":{ "id":"NOIDCOMPUTABLE!", "length":3, "longLength":3, "rank":1, "isReadOnly":false, "isFixedSize":true, "isSynchronized":false, "links":{ "syncRoot":"NOIDCOMPUTABLE!" } }The class being serialised is:
If I serialise one of these (instead of an array) I get the expected output:
{"products":{"id":"1","name":"bob"}}This is running in a Web Api 2 project, with the following setup code in
WebApiConfig.cs:Is there anything I am missing here? I've searched other open issues (and Stackoverflow) but couldn't see this mentioned anywhere.
Thanks.