The service name must not contain a dot

Created on 11 December 2023, 11 months ago
Updated 6 June 2024, 5 months ago

I built a working API client using a combination of the linked documentation and the included examples.

Everything worked beautifully until I had occasion to override a service api configuration, which I was unable to save, due to a "Key contains a dot which is not supported" error. I discovered that this is due to how the configuration is actually stored, like this:

_core:
  default_config_hash: yaddayaddayadda
enable_overriding_service_definitions: 1
overrides:
  my_services.some_verb:
    config:
      base_uri: 'https://an-external-provider.com/api/'
      auth:
        - ''
        - ''
        - Basic

The parameter `my_services.some_verb` does of course contain a dot, and unless I'm completely mistaken, that's in keeping with the documentation here: https://www.drupal.org/docs/contributed-modules/http-client-manager/http... , which provides the following example:

acme_services.contents:
  title: "[ACME] - Contents Services API"
  api_path: "/src/api/resources/content_services.yml"
  config:
    base_uri: "http://api.example.com"
    debug: "/tmp/http.log"

Now, as it happens, the example implementation in the plugin itself doesn't use the dot syntax, specifying only `example_services` in the http_services_api yml. And ultimately, my own solution was to substitute `my_services.some_verb` with `my_services_some_verb` in my own code.

But this is ambiguous, and I think warrants more explicit documentation.

🐛 Bug report
Status

Fixed

Version

3.1

Component

Documentation

Created by

🇺🇸United States datawench

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

Comments & Activities

Production build 0.71.5 2024