JsonDeserializer and YamlDeserializer incorrectly checking data type

Created on 15 August 2025, about 2 months ago

Problem/Motivation

The json_as_string and yaml_as_string data types were added as types that should be kept as strings and not parsed. So the logic below appears reversed from what's intended.

\Drupal\ai\Plugin\AiDataTypeConverter\JsonDeserializer::appliesToDataType()

    if ($data_type !== 'json_as_string') {
      return AppliesResult::notApplicable('The data type is not JSON.');
    }
    return AppliesResult::applicable();

\Drupal\ai\Plugin\AiDataTypeConverter\YamlDeserializer::appliesToDataType()

    if ($data_type !== 'yaml_as_string') {
      return AppliesResult::notApplicable('The data type is not YAML.');
    }
    return AppliesResult::applicable();

Proposed resolution

Reverse it

πŸ› Bug report
Status

Active

Version

1.2

Component

AI Core module

Created by

πŸ‡ΊπŸ‡ΈUnited States michaellander

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