Latest 0.0.2
License MIT
Platforms ios 7.0, requires ARC
Authors ,

A json schema validator for iOS based on


The classes can be added to your project by including /json-schema-validator/Classes/* and /json-schema-validator/Resources/*

or even easier just install it as a CocoaPod.


NSError *errors = [[TFJSONSchemaValidator validator] validate:json withSchema:@"someSchema"]

The parameter json is a NSDictionary representation of the json string, created by using NSJSONSerializer.

If reading up or parsing the schema fails errors will be a NSJSONSerializer error.
Otherwise errors.userInfo[@"errors"] is a array with all the validations errors

Any schema provided is validated against the Core/Validation schema

Deviations from specification

instance type validation

Of a object has more then on of the following:
type, enum, $ref, allOf, anyOf, not

The validation fails with a prefixed with "schema-error"

The reason for this is that the specification does not mention what happens if more then one of the keywords is found.

What does the following mean?

    "allOf" : [{"type" : "string"}],
    "anyOf" : [{"type" : "number"}, {"type" : "null"}]

Regular expressions

Regular expression engine and syntax is not ecma262, instead ICU is used.

The reason for this is that ICU is the engine build into Objective-C and makes parsing and running expressions alot simpler.


$ref’s can reference to a schema in the same NSBundle specified in the constructor (default is [NSBundle mainBundle]).
Schemas are refereced like this: bundle://filename.json

Missing from implementation


  • multipleOf
  • exclusiveMaximum
  • exclusiveMinimum


  • format


  • uniqueItems


  • maxProperties
  • minProperties
  • additionalProperties
  • dependencies

instance type

  • not
  • definitions (only external and any definitions below root level are missing)

Latest podspec

    "name": "json-schema-validator",
    "version": "0.0.2",
    "summary": "A json schema validator for iOS",
    "description": "json-schema-validator is iOS implementation the json-schema draft found at",
    "homepage": "",
    "license": "MIT",
    "authors": {
        "krpiatkowski": "[email protected]",
        "CodeReaper": "[email protected]"
    "platforms": {
        "ios": "7.0"
    "source": {
        "git": "",
        "tag": "0.0.2"
    "source_files": "json-schema-validator/Classes/**/*.{h,m}",
    "resources": [
    "requires_arc": true

Pin It on Pinterest

Share This