Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NSError as a result of validation #9

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions Sources/KiteJSONValidator.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,21 @@

@param jsonData The JSON to be validated
@param schemaData The draft4 JSON schema to validate against
@return Whether the json is validated.
@return Error if json is invalid. Nil if validated
*/
-(BOOL)validateJSONData:(NSData*)jsonData withSchemaData:(NSData*)schemaData;
-(BOOL)validateJSONInstance:(id)json withSchema:(NSDictionary*)schema;

-(NSError*)validateJSONData:(NSData*)jsonData withSchemaData:(NSData*)schemaData;
-(NSError*)validateJSONInstance:(id)json withSchema:(NSDictionary*)schema;

/**
Used for adding an ENTIRE document to the list of reference schemas - the URL should therefore be fragmentless.

@param schemaData The data for the document to be converted to JSON
@param url The fragmentless URL for this document

@return Whether the reference schema was successfully added.
@return Error if the reference schema is invalid. Nil if was successfully added.
*/
-(BOOL)addRefSchemaData:(NSData*)schemaData atURL:(NSURL*)url;
-(NSError*)addRefSchemaData:(NSData*)schemaData atURL:(NSURL*)url;

/**
Used for adding an ENTIRE document to the list of reference schemas - the URL should therefore be fragmentless.
Expand All @@ -42,19 +43,20 @@
@param url The fragmentless URL for this document
@param shouldValidateSchema Whether the new reference schema should be validated against the "root" schema.

@return Whether the reference schema was successfully added.

@return Error if the reference schema is invalid. Nil if was successfully added.
*/
-(BOOL)addRefSchemaData:(NSData*)schemaData atURL:(NSURL*)url validateSchema:(BOOL)shouldValidateSchema;
-(NSError*)addRefSchemaData:(NSData*)schemaData atURL:(NSURL*)url validateSchema:(BOOL)shouldValidateSchema;

/**
Used for adding an ENTIRE document to the list of reference schemas - the URL should therefore be fragmentless.

@param schema The dictionary representation of the JSON schema (the JSON was therefore valid).
@param url The fragmentless URL for this document

@return Whether the reference schema was successfully added.
@return Error if the reference schema is invalid. Nil if was successfully added.
*/
-(BOOL)addRefSchema:(NSDictionary*)schema atURL:(NSURL*)url;
-(NSError*)addRefSchema:(NSDictionary*)schema atURL:(NSURL*)url;

/**
Used for adding an ENTIRE document to the list of reference schemas - the URL should therefore be fragmentless.
Expand All @@ -63,9 +65,9 @@
@param url The fragmentless URL for this document
@param shouldValidateSchema Whether the new reference schema should be validated against the "root" schema.

@return Whether the reference schema was successfully added.
@return Error if the reference schema is invalid. Nil if was successfully added.
*/
-(BOOL)addRefSchema:(NSDictionary *)schema atURL:(NSURL *)url validateSchema:(BOOL)shouldValidateSchema;
-(NSError*)addRefSchema:(NSDictionary *)schema atURL:(NSURL *)url validateSchema:(BOOL)shouldValidateSchema;

@end

Expand Down
Loading