Closed refring closed 1 year ago
Hi, this change allows lists of backed enums without having to implement fromJsonData() on the enum.
Given the following enum:
enum Status : string { case ON = 'ON'; case OFF = 'OFF'; }
And the following property:
#[Json('status_list', type: Status::class)] public array $statusList;
A json document like the following would return 3 Status enums:
{"status_list": ["ON", "OFF", "ON"]}
All committers have signed the CLA.
Thank you, this looks pretty good. Would like to update one or 2 things before this makes it in.
Thanks for the feedback, I've made the changes you suggested.
Hi, this change allows lists of backed enums without having to implement fromJsonData() on the enum.
Given the following enum:
And the following property:
A json document like the following would return 3 Status enums: