fix(server): correctly identify integers

This commit is contained in:
Jason Rasmussen 2025-09-10 22:27:55 -04:00
parent 2d2673c114
commit b0291b6ad6
No known key found for this signature in database
GPG key ID: 75AD31BF84C94773
27 changed files with 152 additions and 135 deletions

View file

@ -53,7 +53,7 @@ class UpdateAssetDto {
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
num? latitude;
double? latitude;
String? livePhotoVideoId;
@ -63,7 +63,7 @@ class UpdateAssetDto {
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
num? longitude;
double? longitude;
/// Minimum value: -1
/// Maximum value: 5
@ -73,7 +73,7 @@ class UpdateAssetDto {
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
num? rating;
int? rating;
///
/// Please note: This property should have been non-nullable! Since the specification file
@ -166,10 +166,10 @@ class UpdateAssetDto {
dateTimeOriginal: mapValueOfType<String>(json, r'dateTimeOriginal'),
description: mapValueOfType<String>(json, r'description'),
isFavorite: mapValueOfType<bool>(json, r'isFavorite'),
latitude: num.parse('${json[r'latitude']}'),
latitude: (mapValueOfType<num>(json, r'latitude')).toDouble(),
livePhotoVideoId: mapValueOfType<String>(json, r'livePhotoVideoId'),
longitude: num.parse('${json[r'longitude']}'),
rating: num.parse('${json[r'rating']}'),
longitude: (mapValueOfType<num>(json, r'longitude')).toDouble(),
rating: mapValueOfType<int>(json, r'rating'),
visibility: AssetVisibility.fromJson(json[r'visibility']),
);
}