Issue #3583071: Advertise a plain map definition as an object on every core

Closes #3583071 (closed).

ContextDefinitionNormalizer treats a definition whose data type is map as a map, the way it already treats the list data type, so an InputDefinition or OutputDefinition declared with data_type: 'map' is advertised as an object on every core. Before 11.1 it came out as {"type": "string"}, because LegacyTypedDataNormalizer has no map schema and the string fallback took over. Plain maps now also get applyMapConstraintSchema() (Count as minProperties/maxProperties).

Tests: new PlainMapSchemaTest checks that a plain map (required and optional, input and output, with a Count) normalizes exactly like the map class equivalent. On Drupal 10.6.18 it fails on 1.0.x and passes here, and AdvertisedOutputSchemaConformanceTest and AdvertisedSchemaAcceptanceTest pass (they fail on 1.0.x, as the issue describes).

Other data types without a legacy arm: binary, language and language_reference come out as string before 11.1 and without any schema on 11.1+ (core has no normalizer for them). The string is narrower but matches what they carry, so no arm is added here.

Edited by Michael Lander

Merge request reports

Loading
Loading