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
If you would emit json-schemas, then one could use ajv for runtime error reporting. I like it because then I can use the same schema to (A) validate strictly (throw errors etc, like MakeTypes does), or (B) ensure valid type by assigning defaults to required fields and using type coercion. Usually one needs to filter additional properties with removeAdditional, but sometimes APIs use objects as hashes where index types are needed. In that case it is good to filter out Object.prototype properties at least so that the resulting objects are well-behaving in runtime. So there could be all kinds of intricacies to get json-schemas work, but it might be worth it.
What's a good way to have decent error messages without adding too much overhead / context tracking embedded in the JSON objects?
The text was updated successfully, but these errors were encountered: