AI-powered
podcast player
Listen to all your favourite podcasts with AI-powered features
Using JSON Schema, You Can Express Programmatically Data Expected Data Shape
In JSONschema, you have a map that describes what you expect the expected field in your map. There are functions for validating and say, okay, here is a piece of data that I got from the user. And if it's not valid, tell me why. With no code, just by writing the schema, you can automatically with middle well generate an error response when something goes wrong. You can even pass function as predicate or numbers in a range or stuff like that. It's richer than static typing because you can express any condition and it's a perfect match with a swagger - there is no downside.