---
sourceDocument: Australia Telecommunications Service Operations Management
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/pt-BR/telecom-service-ops

 Release :

    - australia

ft:locale :

    - pt-BR

ft:publication_title :

    - Australia Telecommunications Service Operations Management

ft:clusterId :

    - tsom

bundleId :

    - tsom

workflow :

    - Customer and Industry


---

# Validate JSON payloads

# Validating JSON payloads using TSOM Schema Validator {#ariaid-title1}

* Versão de lançamento: Australia
* 
* Atualizado 12 de mar. de 2026
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 min. de leitura

Use the TsomSchemaValidator utility class to validate JSON payloads against TSOM schemas before importing data. This helps identify errors early, reduce ETL failures, and confirm data quality.

Use this validator to check whether your JSON payloads conform to the expected schema for telco objects like Devices, Logical Connections, and Topologies before creating import sets. This pre-validation step helps to prevent schema
mismatch errors and improves debugging.

## Supported schema types {#validating-json-payloads-using-tsom-schema-validator__section_ukd_rk2_bgc}

The validator supports multiple schema types for different telco data structures:

* Logical Composites - Representing groupings of components: Equipment, PDUs, Fan Shelves
* Devices - Equipment and their contained components
* Logical Connections - Connections between network interfaces
* Port Relations - Relationships between network interfaces: physical, logical, lags
* Logical Connection Relations - Relationships between logical connections
* Topologies - Network topology
{#validating-json-payloads-using-tsom-schema-validator__ul_w31_nl2_bgc}

## Class structure {#validating-json-payloads-using-tsom-schema-validator__section_ud3_sl2_bgc}

    let TsomSchemaValidator = Class.create();
    TsomSchemaValidator.prototype = {
    initialize: function() {
    this.schemas = new TsomGenericSchema();
    },
    isValidJson: function(payload) {
    // Validation logic that determines if the JSON structure is valid
    // Returns boolean (true/false)
    },
    checkJsonValidation: function(payload) {
    // Validation logic that determines if the JSON structure is valid
    // Returns a JSON object containing errors (if exist)
    },
    type: 'TsomSchemaValidator'
    };

## Steps {#validating-json-payloads-using-tsom-schema-validator__section_pld_vl2_bgc}

1. Instantiate the Schema ValidatorjavascriptCopyEdit

       var TsomSchemaValidator = new sn_tsom_core.TsomSchemaValidator();

2. Run a Boolean Validation Check

       if (!TsomSchemaValidator.isValidJson(target_json)) {
           gs.error('Invalid JSON: ' + JSON.stringify(target_json));
           return;
       }

3. Run a Detailed Validation Check

       let result = TsomSchemaValidator.checkJsonValidation(target_json);
       if (!result.valid) {
           gs.error('Invalid JSON: ' + JSON.stringify(result, null, 2));
           return;
       }

{#validating-json-payloads-using-tsom-schema-validator__ol_t2v_wl2_bgc}

## Example output {#validating-json-payloads-using-tsom-schema-validator__section_qzg_cm2_bgc}

    Example Output
    {
      "schemaName": "devices",
      "errors": [
        {
          "message": "Missing required property: model_name",
          "params": { "key": "model_name" },
          "code": 302,
          "dataPath": "/devices/0/ports/0",
          "schemaPath": "/properties/devices/items/properties/ports/items/required/4"
        }
      ],
      "valid": false
    }

**Conceitos relacionados**   

* [Configuring the Telecom Discovery Builder framework ETL in a connector](https://servicenow-prod.fluidtopics.net/q1NxNSeKh7YJRsAzbXOGfw "Leverage the prebuilt Telecom Discovery Builder framework ETL by duplicating it into your connector scope, assigning the appropriate data source, and deploying it as part of a new service graph connector.")
* [Telecom Discovery Builder framework](https://servicenow-prod.fluidtopics.net/F35IfsseT3EP3Z3thMT_ZA "The Telecom Discovery Builder framework ETL (Extract, Transform, Load) is a reusable and schema-aligned component delivered with the Telecommunications Service Operations Management (TSOM) Core application. It provides a consistent and extensible method for ingesting telecom inventory data into the ServiceNow configuration management database (CMDB) across multiple Service Graph Connectors (SGCs).")

