Skip to content

Navigation Menu

Sign in
Sign up
This repository was archived by the owner on Feb 1, 2026. It is now read-only.

Latest commit

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Twin Descriptor Schema Guide

Configuration Schema Structure For Desired Properties

This section provides an overview of the desired properties schema definition for twin descriptors. The schema definition determines how your twin's configuration form renders in the Console and establishes validation rules for your twin's desired property values.

Annotations Usage

For optimal development experience, we recommend implementing descriptor schemas in TypeScript. This approach offers enhanced maintainability and type safety. Upon publication, your TypeScript schema will be automatically converted to standardized JSON Schema format.

TypeScript field annotations are translated into corresponding JSON schema properties:

/**
 * @title Configuration Name
 * @default "Default Configuration"
 * @minLength 3
 * @maxLength 50
 */
configurationName: string;

The following sections demonstrate annotation examples, including Phygrid-specific implementations.

Optional Properties

By default, all schema properties are required. To designate a property as optional, append a ? to the property name:

 additionalConfig?: string;

Title Annotation

Use the title annotation to define a descriptive label that will be displayed in the Console:

 * @title Connection Settings

Default Values

Specify default values for properties using the default annotation. String values must be enclosed in quotation marks:

 * @default "Default value"

Special Input Types

Media Picker

type Media = {
 ref: 'media';
 type: string;
 id: string;
 url: string;
};
export type Schema = {
 /**
 * @title Media
 * @ui mediaPicker
 */
 media: Media;
}

Queue Picker

type Queue = {
 /**
 * @title Queue ID
 */
 queueId: string;
 /**
 * @title Organisation name
 */
 organization: string;
 /**
 * @title Queue endpoint
 */
 queueEndpoint: string;
};
export type Schema = {
 /**
 * @title Queue
 * @ui queuePicker
 */
 queue: Queue;
}

CSS Field

 /**
 * @title CSS
 * @widget css
 */
 css: string;

Color Picker

 /**
 * @title Color
 * @widget color
 */
 color: string;

Textarea

 /**
 * @title Description
 * @widget textarea
 */
 description: string;

JavaScript Field

 /**
 * @title JavaScript
 * @widget javascript
 */
 js: string;

Boolean Toggle

 /**
 * @title Enable Feature
 * @default true
 */
 isEnabled: boolean;

Space Picker

Configure a space picker with filtering options:

 /**
 * @title Space
 * @ui spacePicker
 * @uiOptions { filterTypes: ["location", "section"], showOnlyWithExternalId: true }
 */
 space: { id: string; externalId: string };

Available filter types:

  • location
  • section
  • floor
  • custom

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages

AltStyle によって変換されたページ (->オリジナル) /