You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current behavior may be misleading when using the API, as the parameter is not injected.
It would be interesting to explicit the reason if the type or the values of these fields are incorrect.
The text was updated successfully, but these errors were encountered:
Thanks for reporting. This behavior is a bit strange but it's the expected behavior from this serializer. I am using JsonUtility here, probably should look into switching to Newtonsoft (already using that one for the event payloads).
The Unity serializer will just use default values for any fields it cannot deserialize without any error indication. Which means that any value for a float field passed in as string will have the float default value 0.
If you actually pass in NaN (as float, not as string, for example using "value": float('nan') in python), it will get correctly deserialized as NaN and you will receive the appropriate error response:
{
"apiName": "VTubeStudioPublicAPI",
"apiVersion": "1.0",
"timestamp": 1704038461572,
"messageType": "APIError",
"requestID": "17bb655841114c35b290e7f65cc27cc6",
"data": {
"errorID": 451,
"message": "Value for parameter FaceAngleX not provided or to big/small."
}
}
Not sure there is a good solution for this without switching the serializer.
Explanation
This bug echoes observations we have made about the VTS-Sharp framework: FomTarro/VTS-Sharp#36
A custom parameter for which I injected a value was never updated, but I received a positive response from the API.
On further investigation, it appears that the API endpoint does not check the type of the given value for the keys :
value
weight
To test this, let's consider a parameter
InputTestParameter
defined as :Exchanged message
Value outside the bounds
Sent
Received
Value is null
Sent
Received
Value is string
Sent
Received
Weight is a string (or null)
Sent
Received
Suggestion
The current behavior may be misleading when using the API, as the parameter is not injected.
It would be interesting to explicit the reason if the type or the values of these fields are incorrect.
The text was updated successfully, but these errors were encountered: