odata_client.odata_server schema errors

Created on 13 January 2025, 11 days ago

Problem/Motivation

We're integrating Odata Client into our tools and have tried to write some PHPUnit tests for it. Upon running them, we get the following error:

Drupal\Core\Config\Schema\SchemaIncompleteException: Schema errors for odata_client.odata_server.odata_org_test with the following errors: odata_client.odata_server.odata_org_test:authentication_method missing schema

/data/app/core/lib/Drupal/Core/Config/Development/ConfigSchemaChecker.php:98
/data/app/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php:111
/data/app/core/lib/Drupal/Core/Config/Config.php:230
/data/app/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php:278
/data/app/core/lib/Drupal/Core/Entity/EntityStorageBase.php:486
/data/app/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php:257
/data/app/core/lib/Drupal/Core/Entity/EntityBase.php:354
/data/app/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:617
/data/app/core/lib/Drupal/Core/Config/ConfigInstaller.php:389
/data/app/core/lib/Drupal/Core/Config/ConfigInstaller.php:149
/data/app/core/lib/Drupal/Core/ProxyClass/Config/ConfigInstaller.php:75
/data/app/core/lib/Drupal/Core/Extension/ModuleInstaller.php:326
/data/app/core/lib/Drupal/Core/ProxyClass/Extension/ModuleInstaller.php:83
/data/app/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php:500
/data/app/core/tests/Drupal/Tests/BrowserTestBase.php:574
/data/app/core/tests/Drupal/Tests/BrowserTestBase.php:369
...

By the looks of it, the config schema's authentication_method field is set up to use an enumeration of none, basic or oauth. While this is admirable I don't think that it works well with the list of types supported by Drupal's config schema API.

https://www.drupal.org/docs/drupal-apis/configuration-api/configuration-...

Steps to reproduce

None, issue is with config schema.

Proposed resolution

Change the schema for the authentication_method field. Perhaps something like...

    authentication_method:
      label: 'Authentication method'
      type: string
     constraints:
      AllowedValues: ['none', 'basic', 'auth']

Remaining tasks

Attempt to make change and see if it works.

User interface changes

None.

API changes

None.

Data model changes

None -- schema is just changing to match the data model saved by the admin form.

🐛 Bug report
Status

Active

Version

3.1

Component

Code

Created by

🇦🇺Australia geoffreyr

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024