Locations as plugin

Created on 29 October 2023, about 1 year ago
Updated 3 November 2023, about 1 year ago

Problem/Motivation

I'm creating an integration with an API-endpoint that can receive a json-payload in any structure. Meaning that the keys or properties depend on uri-variables. See https://developers.home-assistant.io/docs/api/rest/ (POST /api/services/{domain}/{service}) for more details. I'm aware of the json- and body-location types, but they both don't really apply.

Proposed resolution

There are 2 possible solutions:

  1. I add a new location type, Serializer and Deserializer and use those to create a new GuzzleClient in a decorated version of the Drupal\http_client_manager\HttpClient-class. This would remain private, in a separate module;
  2. Via a fork of this module, I create a new plugin type for locations, register the existing ones via regular plugin classes, create a new one for this specific need (can be discussed whether it should be part of this module) and use the plugin manager when creating new instances of the default Serializer and Deserializer.

Remaining tasks

Decide on the path to take, to see if solution 2 would bring value to this module.

API changes

A new plugin type would be introduced.

Feature request
Status

Fixed

Version

3.0

Component

Code

Created by

🇧🇪Belgium lammensj

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

Comments & Activities

Production build 0.71.5 2024