How can I save multiple (checkboxes) values in a configuration entity? I have a standard config entity in Drupal 8.
I'm trying to save multiple values in the form of checkboxes.
The form itself looks like this:

As you can see it's nothing too special about it.
If I try to save it, the following exception occurs:
InvalidArgumentException: The configuration property user_role.anonymous doesn't exist. in Drupal\Core\Config\Schema\ArrayElement-&gt;get() (line 74 of core/lib/Drupal/Core/Config/Schema/ArrayElement.php).


Drupal\Core\Config\StorableConfigBase-&gt;castValue('user_role.anonymous', 'anonymous') (Line: 211)
Drupal\Core\Config\StorableConfigBase-&gt;castValue('user_role', Array) (Line: 212)
Drupal\Core\Config\Config-&gt;save() (Line: 280)
Drupal\Core\Config\Entity\ConfigEntityStorage-&gt;doSave('pl_n_6467f20669ddf097337c47aab87e3c', Object) (Line: 392)
Drupal\Core\Entity\EntityStorageBase-&gt;save(Object) (Line: 259)
Drupal\Core\Config\Entity\ConfigEntityStorage-&gt;save(Object) (Line: 364)
Drupal\Core\Entity\Entity-&gt;save() (Line: 637)
Drupal\Core\Config\Entity\ConfigEntityBase-&gt;save() (Line: 130)
Drupal\pl_notifications\Form\PLNotificationsConfigurationForm-&gt;save(Array, Object)
call_user_func_array(Array, Array) (Line: 111)
Drupal\Core\Form\FormSubmitter-&gt;executeSubmitHandlers(Array, Object) (Line: 51)
Drupal\Core\Form\FormSubmitter-&gt;doSubmitForm(Array, Object) (Line: 585)
Drupal\Core\Form\FormBuilder-&gt;processForm('p_l_notifications_configuration_add_form', Array, Object) (Line: 314)
Drupal\Core\Form\FormBuilder-&gt;buildForm('p_l_notifications_configuration_add_form', Object) (Line: 74)
Drupal\Core\Controller\FormController-&gt;getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 574)
Drupal\Core\Render\Renderer-&gt;executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array) (Line: 144)
Symfony\Component\HttpKernel\HttpKernel-&gt;handleRaw(Object, 1) (Line: 64)
Symfony\Component\HttpKernel\HttpKernel-&gt;handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session-&gt;handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle-&gt;handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache-&gt;pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache-&gt;handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware-&gt;handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware-&gt;handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel-&gt;handle(Object, 1, 1) (Line: 656)
Drupal\Core\DrupalKernel-&gt;handle(Object) (Line: 19)

Which makes perfect sense since I haven't defined that field in the ConfigEntityType.
However, I can't define it since there may be other roles added later on or rather some other roles removed.
Config (schema) defines two basic types of complex/array definitions.

Mapping:
When you have limited, known set of keys, each with a specific type, e.g. a few strings, integers, booleans and so on.

Sequence:
When you have a unlimited list of values that all have the same type but with unknown or numeric keys. Each element must have the same type. The top level in a config entity and simple config is always a mapping (the type there is a config_object or config_entity or so, but those all extend from mapping)

In your example, you would define the user roles as type sequence in config schema, and as a standard php array in your config entity class.

You can also combine this in any way you can imagine, you have a mapping, one key is a list, each element is a mapping, and so on.