Validate JSON Object

Eight Stars

Validate JSON Object

I have the following JSON object coming from a web-service. I need to perform some validations on the object before consuming it.

 

  • I need to ensure that it contains
    • RESULT_1
    • RESULT_2
    • RESULT_15
  • Set an exception/ warning if the data array is empty (like RESULT_15)

What is the best way to achieve this? I could not find any validation information I can plug into tExtractJsonFields component.

 

Any help is appreciated. Thank you.

 

{
	"RESULT_1": {
		"columns": ["col1", "col2", "col3", "col4"],
		"data": [
			["0", null, "12345", "other"],
			["1", "a", "54321", "MA"],
			["0", null, "76543", "RI"]
		]
	},
	"RESULT_2": {
		"columns": ["c1", "c2", "c3", "c4"],
		"data": [
			["", "", "1877", "9"],
			["NULL", "Yellow", "1983", "2"],
			["NULL", "Red", "1981", "0"]
		]
	},
	"RESULT_15": {
		"columns": ["c1", "c2", "c3", "c4"],
		"data": [
			
		]
	}
}

Tutorial

Introduction to Talend Open Studio for Data Integration.

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.