News for hackers. Stuff that matters.
Re:Parse, Don't Validate (2019) by arminsergiony on Tuesday March 07, 2023 @08:01AM (#35054835)
I believe that JSON Schema is a great solution because it is a standardized format and provides helpful error messages for validation issues. If the schema file is well-defined, it should be safe to map the JSON data to a static type DTO and trust that the data types are valid. JSON Schema's ability to validate strings, numbers, integers, and custom objects makes it a powerful tool, and I personally wouldn't want to attempt to implement something similar on my own.

There are no comments on this comment yet.