1. dcutting
  2. VeriJSON


dcutting  committed 01d5acd

Credit where it's due.

  • Participants
  • Parent commits 34011bc
  • Branches default

Comments (0)

Files changed (1)

File README.md

View file
 An Objective-C library for verifying JSON against a pattern-based schema.
-# Patterns
+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.
+## Patterns
+Michael Sprindzuikate suggested the pattern approach for VeriJSON.
 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.
-# Optional properties
+## Optional properties
 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.
-# Regular expressions
+## Regular expressions
 The string type may also include an optional regular expression to which a value must conform.
 	    "date": "130101"
-# URL types
+## URL types
 Links are often expressed in JSON. To verify URLs, use the "url" type.
         "self": "url:http"
-# Usage
+## Usage
 VeriJSON expects the JSON object/array and pattern to be represented as Objective-C objects (as opposed to strings).
 	// Verify the JSON against the pattern.
 	BOOL valid = [[VeriJSON new] verifyJSON:json pattern:pattern];
-# Installing
+## Installing
 [CocoaPods](http://cocoapods.org) is the easiest way to use VeriJSON. Note that you may need to specify the iOS version you're targeting.
 Import VeriJSON in any places you'd like to use it:
 	#import "VeriJSON.h"
+## Related work
+[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.
+By comparison, VeriJSON trades expressiveness for clarity.