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
validateToJSON provides somewhat unhelpful error messages. Here's an example from IOHK codebase:
>>> encode newWallet
"{\"backupPhrase\":[\"shell\",\"also\",\"throw\",\"ramp\",\"grape\",\"chest\",\"setup\",\"mandate\",\"spare\",\"verb\",\"lemon\",\"test\"],\"spendingPassword\":null,\"assuranceLevel\":\"strict\",\"name\":\"My Wallet\",\"operation\":\"create\"}">>> validateToJSON newWallet
["expected JSON value of type SwaggerString"]
It's not mentioned what field was expected to be a JSON value of type SwaggerString, just that one of them was. It would be nice to have more information on what failed the test.
The text was updated successfully, but these errors were encountered:
I totally agree!
In fact I think something like default FromJSON instances do should be doable.
Also we might want to add what that value was (instead of just saying what it is not). In some cases I imagine this might be a huge value, so we could at least mention type of an actual value.
Perhaps something like this could work:
>>> validateToJSON newWallet
["$.spendingPassword: expected JSON value of type SwaggerString but got null"]
Since we're not expected to validate with incredible performance, I think this is a straightforward task.
Would like to implement a patch?
validateToJSON
provides somewhat unhelpful error messages. Here's an example from IOHK codebase:It's not mentioned what field was expected to be a JSON value of type
SwaggerString
, just that one of them was. It would be nice to have more information on what failed the test.The text was updated successfully, but these errors were encountered: