Save ImageBlock error
See original GitHub issuePiranha CMS is a great project, we are planing to use it for our blog system.
When we save an ImageBlock in page or post, there is an error from Json
{“errors”:{“blocks[1].model.body.media.properties”:[“Cannot deserialize the current JSON array (e.g. [1,2,3]) into type ‘System.Collections.Generic.IDictionary`2[System.String,System.String]’ because the type requires a JSON object (e.g. {"name":"value"}) to deserialize correctly.\r\nTo fix this error either change the JSON to a JSON object (e.g. {"name":"value"}) or change the deserialized type to an array or a type that implements a collection interface (e.g. ICollection, IList) like List<T> that can be deserialized from a JSON array. JsonArrayAttribute can also be added to the type to force it to deserialize from a JSON array.\r\nPath ‘blocks[1].model.body.media.properties’, line 1, position 1238.”]},“type”:“https://tools.ietf.org/html/rfc7231#section-6.5.1",“title”:"One or more validation errors occurred.”,“status”:400,“traceId”:“|da6c8724-499ab94159c29f4e.”}
i have check it, because the data from manager/api/media/list can not be deserialized into Piranha.Models.Media.
Property1 size,:“xxxx kb” can not convert to size int64 Property2 properties:[] can not convert to dictonary
so please check these error.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top GitHub Comments
Thank you for your detailed descriptions. A property accessor for set had changed from
internal
topublic
which cased media object to be deserialized and bound when it wasn’t supposed to.So I checked and the error is not present in the latest released version
8.2
. We’ll try to locate the commit that has changed the behavior.