Validating a JSON file using a JSON schema
You can validate JSON columns using the tJSONValidator component.
This scenario applies only to Talend Data Integration, Talend Data Management Platform, Talend Big Data Platform, Talend Real-Time Big Data Platform, Talend MDM Platform, Talend Data Services Platform, Talend MDM Platform and Talend Data Fabric.
Information noteNote: The tJSONValidator component is available only if you have installed
the R2024-11 Talend Studio Monthly
update or a later one delivered by Talend. For
more information, check with your administrator.
About this task
If you want to validate separate records and send each valid/invalid record to the dedicated output component, use raw input data. For more information, see Validating JSON schema using raw input data.
This scenario describes a Job which uses:
- The tFileInputRaw component to use a JSON file as the input.
- The tJSONValidator component to validate JSON columns.
- The tLogRow component to output the results.
Setting up the Job
Procedure
- Drop the following components from the Palette onto the design workspace: tFileInputRaw, tJSONValidator and two tLogRow.
- Connect tFileInputRaw to tJSONValidator using a Main link.
- Connect tJSONValidator to one tLogRow using the FLOW link.
- Connect tJSONValidator to the other tLogRow using the Reject link.
Configuring the input component
Procedure
Configuring the tJSONValidator component
Procedure
Configuring the output component and executing the Job
Procedure
- Double-click the tLogRow components to display the Basic settings view.
- Select Table (print values in cells of a table) for both components.
- Press F6 to save the Job and execute it.
Results
- If all records are valid, they are sent through the FLOW link.
- If at least one record is invalid, all records are sent through the Reject link.