]> git.proxmox.com Git - flutter/proxmox_dart_api_client.git/commit
Add double serializer to handle String and int values
authorAaron Lauterer <a.lauterer@proxmox.com>
Wed, 23 Jun 2021 10:04:43 +0000 (12:04 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 23 Jun 2021 11:18:22 +0000 (13:18 +0200)
commitcaee8926629f5c7f8c69fc9322a395c10f0c4ec9
tree5cbeb49b3f7ea016c20676db865bbde6e26b69cd
parent17b07ab7c63e9c8165296de09b29ca6f02bff1b3
Add double serializer to handle String and int values

Adding a custom serializer for double values allows us to handle
situations in which the PVE API provides values in other types. The most
likely possibility is that numbers are formatted as string in the JSON
response which needs to be parsed to double.

We must also handle the situation that the value is an integer which
needs to be cast to double.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
lib/src/models/pve_double_serializer.dart [new file with mode: 0644]
lib/src/models/serializers.dart