Skip to content

Not parsing lists in response properly #2197

@geofflancaster

Description

@geofflancaster

openapi-fetch version

0.12.0

Description

Using client.GET doesn't properly parse lists that are included in the response. The resulting data object's list is always empty.

Schemas:

CardDetails: {
            ...
            dependent_names?: components["schemas"]["CardAttribute"][] | null;
            ...
        };
CardAttribute: {
            /** Scores */
            scores: string[];
            /** Value */
            value: string;
        };

Json response:

{
        "id": "2txki5MfjWhqQNnUchuOsp89h2T",
...
        "metadata": {
            "details": {
                ...
                "dependent_names": [
                    {
                        "value": "first last",
                        "scores": [
                            "0.993",
                            "0.999"
                        ]
                    }
                ],
                "phone_numbers": null,
                "addresses": null,
                "copays": null
                ...
            }
        }
    },

Reproduction

Create an array of objects and verify whether they get parsed properly or not

Expected result

the data object from client.GET() should include the dependent_names details instead of always being an empty array

Extra

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingopenapi-fetchRelevant to the openapi-fetch library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions