Support for required configuration in schema definition

Created on 2 May 2017, over 7 years ago
Updated 14 March 2024, 10 months ago

Problem/Motivation

Schema configuration is optional and that can lead to missing configuration values, that are actually required for proper functioning of system. That's why it should be supported that some configuration options are defined as required.

This functionality would improve configuration quality and it would reduce update problems, or wrong configurations stored from UI, etc.

Proposed resolution

We can use same logic as it already exists for kwalify:
(offline in 2023 😭) https://pykwalify.readthedocs.io/en/unstable/validation-rules.html#required

To add "required" option, that is by default: false, and then we can start using that in schema.

Remaining tasks

  1. add support for new schema configuration option
  2. start using it in trait SchemaCheckTrait
  3. as first use case, use new feature for "langcode" and get rid of hacky part of code:
        // We'd like to verify that the top-level type is either config_base,
        // config_entity, or a derivative. The only thing we can really test though
        // is that the schema supports having langcode in it. So add 'langcode' to
        // the data if it doesn't already exist.
        if (!isset($config_data['langcode'])) {
          $config_data['langcode'] = 'en';
        }
✨ Feature request
Status

Closed: outdated

Version

11.0 πŸ”₯

Component
ConfigurationΒ  β†’

Last updated about 17 hours ago

Created by

πŸ‡©πŸ‡ͺGermany mtodor

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024