Http data issues and changes

Created on 8 December 2023, 10 months ago
Updated 13 July 2024, 3 months ago

Problem/Motivation

Drupal\migrate_plus\Plugin\migrate_plus\data_fetcher\Http::getResponse now requires returning a ResponseInterface.
This makes sense given that ::getResponseContent will call ->getBody() on the return from getResponse.

Solution

  • ::getResponse calls the apitools client, either with changed methods or with a simple method.
  • The apitools client methods need to be able to return array-like values as they are not intended to be methods specific to a migration http data fetcher.
  • The return from an apitools client can now use an IterableResponse class.
  • This will allow other implementations to iterate over the data results directly, while also allowing getResponse to return a ResponseInterface
  • The getResponseContent will need to bypass use of getBody() and get the array that was embedded in IterableResponse.
  • It will then need to re-encode this array to match the expectations of the data parser in the migration.
πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States asherry

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

Comments & Activities

Production build 0.71.5 2024