# Importing a JSON Schema

Talend Data Mapper allows you to create a JSON structure from a JSON Schema.

For more information about the support of JSON Schema elements, see [JSON Schema support](https://help.qlik.com/talend/en-US/data-mapper-user-guide/8.0/json-schema-support).

Talend Data Mapper does not use JSON Schemas to validate JSON documents. They are only used as models to create JSON structures. For example, if a string is defined as "maxLength": 15, no error will be returned if the string exceeds 15 characters.

## Before you begin

* You have a JSON Schema file to import.
* You have added any references that need to be ignored to the Reference blacklist in Window &gt; Preferences &gt; Mapping &gt; Representations. For more information, see [Representation preferences](https://help.qlik.com/talend/en-US/data-mapper-user-guide/8.0/representation-preferences).

## About this task

This example uses the following JSON Schema:

```
{
    "$id": "https://example.com/arrays.schema.json",
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "description": "A representation of a list of customers.",
    "type": "object",
    "properties": {
        "customers": {
            "type": "array",
            "items": {
                "$ref": "#/$defs/customer"
            }
        }
    },
    "$defs": {
        "customer": {
            "type": "object",
            "properties": {
                "LastName": {
                    "type": "string",
                    "description": "The customer's last name."
                },
                "firstName": {
                    "type": "string",
                    "description": "The customer's last name."
                },
				"address": {
					"type": "object",
					"description": "The customer's address.",
					"properties": {
						"street": {
							"type": "string"
						},
						"postCode": {
							"type": "integer"
						},
						"city": {
							"type": "string"
						},
						"state": {
							"type": "string"
						},
						"country": {
							"type": "string"
						}
					}
				}
					
            }
        }
    }
}
```

## Procedure

1. In the Data Mapper tab, expand the Hierarchical Mapper node and right-click Structures.
2. Click New &gt; Structure.
3. In the wizard that opens, select Import a structure definition and click Next.
4. Select the type of import, JSON Schema in this example, and click Next.
5. Select the file to use:
   * Select an existing resource in your workspace.
   * Import a local file.
   * Enter the URL to the file.
6. Click Next.
7. Select a folder and enter a name for your structure, then click Next.
8. Click Finish.

## Results

A JSON structure is created with all the elements specified in the schema. If you import a sample document following this schema, you can see the elements highlighted correctly. With the schema used in this example, you can import the following sample:

```
{
   "customers":[
      {
         "lastName":"Smith",
         "firstName":"Jane",
         "address":{
            "street":"4876 Felosa Drive",
            "postCode":90017,
            "city":"Los Angeles",
            "state":"CA",
            "country":"United States"
         }
      },
	  {
         "lastName":"Doe",
         "firstName":"John",
         "address":{
            "street":"4862 Parkway Street",
            "postCode":92203,
            "city":"Bermuda Dunes",
            "state":"CA",
            "country":"United States"
         }
      }
   ]
}
```

The result looks like this: ![Schema result.](https://help.qlik.com/talend/en-US/data-mapper-user-guide/Resources/images/import_json_schema_02_result.png)

### In this section

* [JSON Schema support](https://help.qlik.com/talend/en-US/data-mapper-user-guide/8.0-R2025-05/json-schema-support)