Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You are serializing only the properties of the <code>Geometry</code> object, even though the actual object is a <code>MultiPolygon</code>. <a href="https://stackoverflow.com/a/10759250/149060">As explained by Mythz,</a> </p> <blockquote> <p>As there is no concept of 'type info' in the JSON spec, in order for inheritance to work in JSON Serializers they need to emit proprietary extensions to the JSON wireformat to include this type info - which now couples your JSON payload to a specific JSON serializer implementation.</p> </blockquote> <p>To enable support for polymorphic <code>Geometry</code> objects in Servicestack.text, add a type specific config setting to add 'type info' to the output. i.e.:</p> <pre><code>JsConfig&lt;Geometry&gt;.ExcludeTypeInfo = false; </code></pre> <p><em>(may also require adding an interface. See the <a href="https://github.com/ServiceStack/ServiceStack.Text/blob/master/tests/ServiceStack.Text.Tests/JsonTests/PolymorphicListTests.cs" rel="nofollow noreferrer">tests for Polymorphic List serialization.</a> and <a href="https://github.com/ServiceStack/ServiceStack.Text/blob/master/tests/ServiceStack.Text.Tests/JsonTests/PolymorphicInstanceTest.cs" rel="nofollow noreferrer">tests for Polymorphic Instance serialization.</a> for examples)</em></p> <p>If you are loath to expose type info in your json, you can use <a href="https://github.com/ServiceStack/ServiceStack.Text/blob/master/tests/ServiceStack.Text.Tests/JsonTests/CustomSerializerTests.cs" rel="nofollow noreferrer">custom serializers</a> as an alternative solution.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload