Defining a custom object of type DSV

  1. To create an object of type DSV, prepare this folder structure for the import:

    FOLDER: DSV

    +--FOLDER: <object name>

    +----FILE: <object name>.schema.json

    +----FILE: <object name>.properties.json

  2. These validations are performed upon import:
    • The object name must be unique and must comply to the object naming restrictions mentioned above.
    • If an object with the same name is already registered with another type, the import fails.
    • If an object with the same name is already registered with type DSV, the imported schema overwrites the existing schema.
    • The <object name>.schema.json schema file is validated as follows:
      • There must be only one DSV schema for a given object name.
      • The schema file must use UTF-8 encoding.
      • The schema file must contain a “dialect” property. This property defines the format of the delimited data object.

        The dialect property must contain a “separator” property, which defines the character that separates the values in a row within the data object.

      • The “properties” element in the schema file should list the fields, in order, that are expected to be found in the DSV data object. This section of the schema must be valid JSON according to schema definition, version draft-06.
        • The “anyOf” keyword is not allowed.
        • The “oneOf” keyword is supported only to describe a type that can be null.
    • The <object name>.properties.json file is optional and can contain additional metadata properties for the object.

      For information on how to define this file, see Defining additional object metadata properties and Additional properties file.

    This code is an example of a DSV schema definition:
    {
       "title": "myDelimitedFile",
       "description": "DSV Schema for myDelimitedFile",
       "dialect": {
          "separator": ",",
          "skipLines": 1,
          “headerLine”: 1,
          "enclosingCharacter": "\""
       },
       "properties": {
          "Code": {
             "description": "Customer code",
             "type": "string",
             "maxLength": 10
          },
          "Customer": {
             "description": "Customer name",
             "type": "string",
             "maxLength": 100
          },
          "PubDatetime": {
             "description": "Publication timestamp",
             "type": "string",
             "format": "date"
          }
        }
      }