address_line1 and address_line2 are problematic fieldnames for toCamelCase and toSnakeCase converters

Created on 19 October 2023, about 1 year ago
Updated 31 October 2023, about 1 year ago

Problem/Motivation

I just noticed, when working on a Vue3 (Frontend Framework) project, which needs an JSON:API requests and therefore converters between Drupals snake_case field names and Vue3's expected camleCase names, that most camelCase to snake_case converters treat numbers in strings as something which needs to be separated by an "_". Therefore the conversion of "address_line1" to camelCase is fine "addressLine1" but the back convert is "address_line_1", which then gets errors thrown by JSON:API.

I guess there is no easy fix for that. I just wanted to mention it. because Decoupled frontends based on javascript will very likly have the same Javascript / Typescript naming conventions.

💬 Support request
Status

Fixed

Version

1.12

Component

Code

Created by

🇩🇪Germany ro-no-lo

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

Comments & Activities

Production build 0.71.5 2024