Files changed (1)
+VeriJSON is designed to verify that the JSON you've received from a web service has the structure you expect before you try to extract information from it.
A pattern describes the expected content of a JSON document. Patterns are themselves valid JSON, and mirror the structure of a matching JSON document by including property names, arrays and objects. Instead of values, a pattern specifies the required type of values.
By default, all properties in the pattern are mandatory. JSON documents omitting the properties are not considered to match. However, properties appearing in the JSON document that are not part of the pattern are ignored and considered to match.
If a property within an object is optional, suffix its name in the pattern with a question mark '?'.
Note that an optional property may also have a "null" value. This is not true of non-optional properties.
VeriJSON expects the JSON object/array and pattern to be represented as Objective-C objects (as opposed to strings).
[CocoaPods](http://cocoapods.org) is the easiest way to use VeriJSON. Note that you may need to specify the iOS version you're targeting.
+[JSON Schema](http://json-schema.org) is another JSON based format for describing JSON data. It is more explicit in the way it models documents, and is able to describe more complicated structures. There are also a number of existing implementations.