Examples

Examples are supported in data contracts.

Examples in the data contract contain example datasets. Examples are a way to help a potential data consumer to quickly get a feeling for the data.

The Data Mesh Manager supports examples in different types:

  • csv
  • json
  • yaml
  • custom (fallback, no parsing)

csv

Example with csv data

examples:
  - type: csv
    model: orders
    description: An example for orders with unmasked attributes
    data: |
      order_id,customer_id,email,phone_number,order_date,order_total
      1,101,[email protected],555-123-4567,2023-07-01,100.50
      2,102,[email protected],555-987-6543,2023-07-02,75.25

json

Example with json data

examples:
  - type: json
    model: orders
    description: An example for orders with unmasked attributes
    data: |
      [
        {
          "order_id": 1,
          "customer_id": 101,
          "email": "[email protected]",
          "phone_number": "555-123-4567",
          "order_date": "2023-07-01",
          "order_total": 100.50
        },
        {
          "order_id": 2,
          "customer_id": 102,
          "email": "[email protected]",
          "phone_number": "555-987-6543",
          "order_date": "2023-07-02",
          "order_total": 75.25
        }
      ]

yaml

Example with yaml data

examples:
  - type: yaml
    model: orders
    description: An example for orders with unmasked attributes
    data: |
      - order_id: 1
        customer_id: 101
        email: [email protected]
        phone_number: "555-123-4567"
        order_date: "2023-07-01"
        order_total: 100.50
      - order_id: 2
        customer_id: 102
        email: [email protected]
        phone_number: "555-987-6543"
        order_date: "2023-07-02"
        order_total: 75.25


custom

Example with custom data

examples:
  - type: custom
    model: orders
    description: This is a custom example
    data: |
      Some custom example data
      that cannot be parsed and shown in a tabular form in the Data Mesh Manager Web UI
      and cannot verify that the fields are defined by the schema