Results 1 to 1 of 1
- 02-11-2011, 09:15 AM #1
Member
- Join Date
- Feb 2011
- Posts
- 1
- Rep Power
- 0
Validate JSON according XSD schema
Hi,
Some site have REST API that return responses in two formats : xml and JSON .
Currently I finished basic checks for xml responses of this API .
Idea was simple - validate xml response using existing xsd schema that clear define what should be inside . I use Jersey (— Project Kenai ) for "speaking" with API and SAX to validate responses.
Now I need to do the same for JSON format . First big problem here is that I don't have JSON Schema to validate JSON response . So only way that I see is unmarshall JSON response to POJO hierarchy and then validate it against xsd that I have . But this way also raise up hard questions : I can't find Java classes that allow me to do this automatically . Also I can't find classes that allow me to work with xsd in low level - I mean not just general "tell me if this xml is valid according this xsd" but "tell me if this tag can have such children with such types".
Any ideas , directions or just thoughts are welcome. Maybe somebody can suggest totally different way ? Or somebody can suggest classes that allow to work with xsd on low level ?
Similar Threads
-
hashmap to json
By prakashkadakol in forum New To JavaReplies: 5Last Post: 07-30-2011, 01:32 AM -
Json
By mac in forum New To JavaReplies: 10Last Post: 06-08-2010, 11:15 PM -
JSON Lib: json-lib-1.0-jdk13.jar
By Raghuraman K in forum Advanced JavaReplies: 3Last Post: 05-13-2010, 10:00 AM -
DB Values to JSON
By prakashkadakol in forum New To JavaReplies: 1Last Post: 01-05-2010, 06:19 PM -
XML Schema
By Abder-Rahman in forum XMLReplies: 1Last Post: 02-22-2009, 04:33 PM


LinkBack URL
About LinkBacks

Bookmarks