Creating field with multiple properties I am creating a Field plugin, where I have requirement as below

Field name : Question

Properties:

Question Text : String

Question Type : integer (0,1,2)

Question Options : Array of Strings

I defined schema like this. I am not sure if I am doing it right for Question Option

public static function schema(FieldStorageDefinitionInterface $field_definition) {
    $schema = [
        'columns' =&gt; [
            'question_text' =&gt; [
                'type' =&gt; 'varchar',
            ],
            'option_type' =&gt; [
                'description' =&gt; 'Option Type: 0 = radio, 1 = checkbox',
                'type' =&gt; 'int',
                'default' =&gt; 0,
            ],
            'question_option' =&gt; [
                'type' =&gt; 'varchar',
                'serialize' =&gt; TRUE,
            ],
        ],
    ];

    return $schema;
}


And for property definition I have following

public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {

    $properties['question_text'] = DataDefinition::create('string');
    $properties['option_type'] = DataDefinition::create('integer');

    $properties['question_option'] = DataDefinition::create('string');

    return $properties;
}


Please let me know how can I do it for the question_option.

--

Thanks
If you want an array of strings maybe your should use a blob in you schema:

 'question_option' =&gt; [
          'type' =&gt; 'blob',
          'size' =&gt; 'big',
          'not null' =&gt; TRUE,
          'serialize' =&gt; TRUE
        ],


Note that by default 'size' = 'normal' which max storage value is 16KB so if it is enough for you use 'big'; 'big' can handle up to 4GB.
And for properties as follow:

$properties['question_options'] = MapDataDefinition::create()-&gt;setLabel(t('Options'))