Skip to content

JSON Array cast #5

@mobilefocustoar

Description

@mobilefocustoar

How are you.
I think that this library is useful.

But, I have a problem in programming. I need your help.

If the result is json object, and it is simple:
{
"type":"xxx",
"currency":"btc",
"amount":"0.0",
"available":"0.0"
}

class is following:
export class Response extends Castable {
@cast type: string;
@cast currency: string;
@cast amount: number;
@cast available: number;
}

But json response is array. There is no key.
the json response is following:
[{
"type":"xxx",
"currency":"btc",
"amount":"0.0",
"available":"0.0"
},{
"type":"xxx",
"currency":"usd",
"amount":"1.0",
"available":"1.0"
},{
"type":"xxx",
"currency":"btc",
"amount":"1",
"available":"1"
}]

what is class for castable?
Please teach me.

Regards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions