I need some hints how to implement a behavior with a JSONField.
Via RESTAPI we can add a JSONField of type "dict" with a "json" widget.
-X POST \
-H "Accept: application/json"\
-H "Content-Type: application/json" \
"description": "My Json field",
But I cannot find any documentation neither for type "dict" nor for widget "json".
In following docs I was not able to find any hints.
Don't understand what you are trying to accomplish...but why isn't it sufficient to store a JSON string as
What I need: I have different Dexterity types that have a JSON-field. I don't want to repeat code and add that field to every type. I think this could be best accomplished with a behaviour.
Why a Text field is not optimal: The text field simple stores a string and makes no checks at all. The JSONField checks if the JSON (i.e. the dict) is "well-formed"
I need a way to create a JSONfield and its widget in a behavior.
Any field can have its own validators.
Deriving your own JSONField from Text does not seem to be so complicated.
Cant you just add a JSON field in Dexterity Editor and then copy the XML (syntax) you get to your behaviour (field) ?
The JSONField is not a
IText-ish field. Actually it is a
What I'm searching for is the
json widget for a
With other words: is there a documentation or a link to source code that explains the options and the meaning of the
widget-key called by plone.restapi
@types (see example in my question)?