ui-config.json
This page provides a comprehensive guide for developers on how to create and structure ui-config.json files used for auto-generating UIs for connectors.
General Overview
JSON Schema Standard:
The file follows the JSON Schema standard (
type
,properties
,required
, etc.).Developers should ensure compatibility with standard JSON Schema parsers for validation purposes.
Custom Fields:
helptext
: A custom field providing detailed guidance that appears when a user focuses on a field.uiIndex
: Specifies the display order of fields in the UI.
Flat Structure: Ensure all fields are at the top level. Nested objects are not allowed.
Key Attributes:
description
: Provides subtext for the input field.helptext
: Provides detailed guidance when the user focuses on the field.format
: Extended to include:hidden
: For fields with non-editable default values.password
: For sensitive inputs to hide entered text.
Field Ordering: Use the
uiIndex
attribute to dictate the order of fields in the UI.
Core Sections in the ui-config.json
ui-config.json
1. Metadata
title
: Title displayed in the UI.description
: Brief summary of the connector setup.helptext
: General instructions for the user.
2. Properties
Each property represents a field in the UI. Define its type, validation rules, and additional UI hints.
Example Field: Kafka Brokers
Field Attributes
type
: Data type (e.g.,string
,enum
).description
: Short subtext visible below the field.helptext
: Rich-text or HTML for focus-specific guidance.pattern
: Regex for input validation.default
: Default value, if any.enum
: Allowed values for dropdowns or similar fields.format
: Used forhidden
orpassword
to modify input behavior.
Example Fields
Below are sample configurations for common Kafka connector fields:
Kafka Brokers (Required)
User inputs Kafka broker addresses.
Validation ensures correct format.
Kafka Topic (Required)
Alphanumeric with dots, dashes, or underscores.
Clear helptext and example.
Kafka Auto Offset Reset (Optional)
Dropdown with predefined values.
Kafka Consumer Group ID (Required)
Alphanumeric name identifying the consumer group.
Data Format (Hidden Default)
Predefined formats like
json
,csv
,parquet
.
Required Fields
Specify the list of fields mandatory for the configuration:
Best Practices
Descriptive Text:
Ensure
description
andhelptext
are clear and concise.Use examples where appropriate.
UI Experience:
Use
uiIndex
for logical field order.Leverage
hidden
for technical defaults andpassword
for secure inputs.
Validation:
Use
pattern
for format enforcement.Provide feedback for invalid inputs.
Example JSON
Here’s a full example for a Kafka connector:
Structure for Multi-Tenant Configurations
A multi-tenant connector's ui-config.json
organizes configurations under source-specific keys. Each key contains the UI configuration specific to that source, using the same schema as single-source connectors.
Example Structure
Using object store connectors ui-config.json file:
Guidelines for Multi-Tenant Connectors
Source-Specific Keys:
Use keys like to represent each source. For ex: an object store connector pulling data from multiple storage types can use the keys
aws-s3
,azure-blob
, orgcp-storage
Each key encapsulates the configuration for that specific source type.
Consistent Schema:
The structure within each key follows the same JSON Schema standard as single-source connectors.
This ensures consistent validation and UI generation.
UI Differentiation:
Fields, help text, and validation can vary by source to accommodate source-specific requirements.
Dynamic Selection:
The UI can dynamically display the relevant configuration based on the source type selected by the user.
Best Practices for Multi-Tenant Configurations
Clearly Defined Source Keys:
Use meaningful and consistent source identifiers (e.g.,
aws-s3
,azure-blob
).
Modular Design:
Treat each source configuration as an independent module for easy updates and reusability.
Dynamic UI:
Leverage UI logic to dynamically display fields based on the selected
source_type
.
Validation:
Ensure each source configuration has clear validation rules and
required
fields.
Last updated