Filter module won't let me add nested values to my configuration I'm working on the D8 port of my xbbcode module; my latest sources are here.

The module is supposed to let administrators enable individual BBCode tags either in the global default settings or in an individual text format that overrides those defaults.

The settings structure for both is basically (in YAML):

tags:
  abbr:
    module: xbbcode
    enabled: 0
  b:
    module: xbbcode_basic
    enabled: 1
  [...]


The default configuration (set in the annotation comment of my filter plugin class) is

/**
 * Provides a filter that converts BBCode to HTML.
 *
 * @Filter(
 *   id = "xbbcode",
 *   title = @Translation("Convert BBCode into HTML."),
 *   type = Drupal\filter\Plugin\FilterInterface::TYPE_MARKUP_LANGUAGE,
 *   settings = {
 *     "autoclose" = FALSE,
 *     "override" = FALSE,
 *     "tags" = {}
 *   }
 * )
 */


However, when I try to create a new text format, I get the following error:

InvalidArgumentException: The configuration property filters.xbbcode.settings.tags.abbr
doesn't exist.
in Drupal\Core\Config\Schema\ArrayElement-&gt;get() 
(line 97 of core/lib/Drupal/Core/Config/Schema/ArrayElement.php).

Drupal\Core\Config\StorableConfigBase-&gt;castValue('filters.xbbcode.settings.tags.abbr', Array)
Drupal\Core\Config\StorableConfigBase-&gt;castValue('filters.xbbcode.settings.tags', Array)
Drupal\Core\Config\StorableConfigBase-&gt;castValue('filters.xbbcode.settings', Array)
Drupal\Core\Config\StorableConfigBase-&gt;castValue('filters.xbbcode', Array)
Drupal\Core\Config\StorableConfigBase-&gt;castValue('filters', Array)
Drupal\Core\Config\Config-&gt;save()
Drupal\Core\Config\Entity\ConfigEntityStorage-&gt;doSave('bb2', Object)
Drupal\Core\Entity\EntityStorageBase-&gt;save(Object)
Drupal\Core\Config\Entity\ConfigEntityStorage-&gt;save(Object)
Drupal\Core\Entity\Entity-&gt;save()
Drupal\filter\FilterFormatFormBase-&gt;submitForm(Array, Object)
Drupal\filter\FilterFormatAddForm-&gt;submitForm(Array, Object)
call_user_func_array(Array, Array)
Drupal\Core\Form\FormSubmitter-&gt;executeSubmitHandlers(Array, Object)
Drupal\Core\Form\FormSubmitter-&gt;doSubmitForm(Array, Object)
Drupal\Core\Form\FormBuilder-&gt;processForm('filter_format_add_form', Array, Object)
Drupal\Core\Form\FormBuilder-&gt;buildForm(Object, Object)
Drupal\Core\Controller\FormController-&gt;getContentResult(Object, Object)
call_user_func_array(Array, Array)
Symfony\Component\HttpKernel\HttpKernel-&gt;handleRaw(Object, 1)
Symfony\Component\HttpKernel\HttpKernel-&gt;handle(Object, 1, 1)
Drupal\Core\StackMiddleware\Session-&gt;handle(Object, 1, 1)
Drupal\Core\StackMiddleware\KernelPreHandle-&gt;handle(Object, 1, 1)
Drupal\Core\StackMiddleware\PageCache-&gt;pass(Object, 1, 1)
Drupal\Core\StackMiddleware\PageCache-&gt;handle(Object, 1, 1)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware-&gt;handle(Object, 1, 1)
Drupal\Core\StackMiddleware\NegotiationMiddleware-&gt;handle(Object, 1, 1)
Stack\StackedHttpKernel-&gt;handle(Object, 1, 1)
Drupal\Core\DrupalKernel-&gt;handle(Object)


Some examination of the StorableConfigBase class reveal that it seems to insist on merging my configuration values with the existing ones, down to the bottom level, and when it doesn't find the "abbr" key it shuts down. This seems pretty silly, because obviously an array can gain or lose entries when you save it.

The weird thing is that the global defaults have absolutely no problem when I change them with $this-&gt;config('xbbcode.settings')-&gt;set('tags', [...])-&gt;save() in my own ConfigFormBase settings form.

Edit: filter.format.* has a config schema, while my module doesn't. I'm not sure how to tell this schema "this array may have a number of keys, each of which has the form {enabled: ..., module: ... }
I figured out how to declare the filter settings schema by comparing with modules/filter/config/schema/filter.schema.yml and using the Schema docs.

Apparently my schema file simply needs to declare

filter_settings.xbbcode:
  type: filter
  label: 'XBBCode filter'
  mapping:
    [...]