Skip to content

Conversation

@SelfDiseased
Copy link
Contributor

Description

Fixes type generation for arrays of objects, including handling of nested arrays.

Example:
Let's assume we have the following JSON:

{
  "OBJECTS_ARRAY": [
    { "instructions": "Please follow the link" },
    {
      "nestedArrayInstructions": [[{ "instructions": "Please try again" }]]
    }
  ]
}

Old generated type:

export type I18nTranslations = {
    "OBJECTS_ARRAY": [
        string,
        string
    ];
};

Generated type after fix:

export type I18nTranslations = {
    "OBJECTS_ARRAY": [
        {
            "instructions": string;
        },
        {
            "nestedArrayInstructions": [
                [
                    {
                        "instructions": string;
                    }
                ]
            ];
        }
    ];
};

Linked Issues

fixes #706

Additional context

@toonvanstrijp toonvanstrijp merged commit 11ca9bd into toonvanstrijp:main Nov 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Type of array of object generated as array of string

2 participants