I'm trying to implement a custom PropertyDefinitionTypePlugIn for JSON data with the following spec.
I'm finding this quite hard to implement though because of issues with "Lazy loaded property value is not supported by the current property instance" when serialized string is more than 255 characters.
How are we supposed to properly implement ILazyProperty? First of all, it's in an internal namespace and I can't find any documentation. And when looking at PropertyLongString implementation there is a load of internal code.
I really don't want to create a messy implementation that inherits from PropertyLongString with overrides and inline serializing/deserializing. I have done this before, but have never felt good about it so I thought that I will ask this time to see if I'm missing something. It's too complicated to do this basic thing. :)
I want to learn more about the ILazyProperty myself actually. Any chance you could post your new type so I can have a play?
The lazy loading error can be also caused by duplicate property definitions in the database — which can happen when you update the namespace in your property class for example. I wrote this article about the error for version 11 of the CMS. It might not help you with your 255 limit problem, but I recommend keeping tabs of your property definition in the database. (Property definition editing view has been removed from the CMS in version 12?)
Note that there is the PropertyJson class that you can try to inherit from instead of PropertyLongString. I did some digging and it looks like this stores the JSON as a LongString in the database. The PropertyJsonTransform and JsonPropertyValueConverter classes handle the serialization and what not. Then there are also these internal classes: ContentReferenceDatabaseJsonConverter & DefaultPropertyJson
Hope this helps 😃