active is not a CSV header
CSV does not split a nested object into columns. On the JSON converter, top-level keys become headers. A nest stays one cell. Conversion runs in the browser. Nothing is uploaded.
The sample shape
When meta holds {"active":true}, CSV prints a meta column. The cell is the nested object as JSON text, with quotes doubled so the row stays valid:
id,name,role,meta 1,Ada,engineer,"{""active"":true}" active is not its own header. It stays inside that cell.
How the other formats treat the nest
Laravel still nests a PHP array for meta. TypeScript drafts interface Meta and types the field as Meta. The PHP DTO types meta as public array $meta with no child class. Same paste, four different shapes.
An array value is also one CSV cell. {"id":1,"tags":[]} converts to a tags cell of [].
Keep parse errors separate
A trailing comma such as {"a":1,} clears every format. Repair broken text in the JSON formatter, then convert again.
Guide: https://kepttools.com/guides/json-to-typescript-php-dto-laravel
原文:https://www.a8q9.cn/en/article/active-is-not-a-csv-header-d74a6a.html