Hello, when using Cloud Save, I get an error HttpException`1: HTTP/1.1 400 Bad Request.
The data I am sending is a string created by serialization of an object containing primitive datatypes (int, float, bool, string). The JSON serialization appears valid (attached), I don’t see any red flags looking at the data.
What is the best way to troubleshoot this? Are there certain characters that are invalid that I need to look out for?
Unity Editor ver: 2021.3.3f1 / Windows
Cloud Save ver: 2.0.1
string payload = JsonUtility.ToJson(SceneState);
var dataCollection = new Dictionary<string, object> { { key, payload } };
await CloudSaveService.Instance.Data.ForceSaveAsync(dataCollection);
Error Log:
CloudSaveValidationException: There was a validation error. Check ‘Details’ for more information.
HttpException1: HTTP/1.1 400 Bad Request Unity.Services.CloudSave.Internal.Http.ResponseHandler.HandleAsyncResponse (Unity.Services.CloudSave.Internal.Http.HttpClientResponse response, System.Collections.Generic.Dictionary
2[TKey,TValue] statusCodeToTypeMap) (at Library/PackageCache/com.unity.services.cloudsave@2.0.1/Runtime/Generated/Runtime/Http/ResponseHandler.cs:103)
Unity.Services.CloudSave.Internal.Http.ResponseHandler.HandleAsyncResponse[T] (Unity.Services.CloudSave.Internal.Http.HttpClientResponse response, System.Collections.Generic.Dictionary2[TKey,TValue] statusCodeToTypeMap) (at Library/PackageCache/com.unity.services.cloudsave@2.0.1/Runtime/Generated/Runtime/Http/ResponseHandler.cs:186) Unity.Services.CloudSave.Internal.Apis.Data.DataApiClient.SetItemBatchAsync (Unity.Services.CloudSave.Internal.Data.SetItemBatchRequest request, Unity.Services.CloudSave.Internal.Configuration operationConfiguration) (at Library/PackageCache/com.unity.services.cloudsave@2.0.1/Runtime/Generated/Runtime/Apis/DataApi.cs:249) Unity.Services.CloudSave.ApiClient.ForceSaveAsync (System.Collections.Generic.Dictionary
2[TKey,TValue] data) (at Library/PackageCache/com.unity.services.cloudsave@2.0.1/Runtime/ApiClient.cs:57)
Unity.Services.CloudSave.SaveDataInternal.ForceSaveAsync (System.Collections.Generic.Dictionary2[TKey,TValue] data) (at Library/PackageCache/com.unity.services.cloudsave@2.0.1/Runtime/SaveData.cs:158) Rethrow as CloudSaveValidationException: There was a validation error. Check 'Details' for more information. Unity.Services.CloudSave.SaveDataInternal.ForceSaveAsync (System.Collections.Generic.Dictionary
2[TKey,TValue] data) (at Library/PackageCache/com.unity.services.cloudsave@2.0.1/Runtime/SaveData.cs:167)
CloudData.SaveData (System.String key, System.Object data, CloudData+OnReturn_Empty callback) (at Assets/01_Scripts/User/CloudData.cs:59)
System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.b__7_0 (System.Object state) (at <6073cf49ed704e958b8a66d540dea948>:0)
UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at :0)
UnityEngine.UnitySynchronizationContext.Exec () (at :0)
UnityEngine.UnitySynchronizationContext.ExecuteTasks () (at :0)
8400549–1109133–exampleData.txt (14.6 KB)