1{ 2 "title": "JSON schema for forms.json", 3 "$schema": "http://json-schema.org/draft-07/schema#", 4 "type": "object", 5 "additionalProperties": true, 6 "required": [ 7 "forms" 8 ], 9 "propertyNames": { 10 "enum": [ 11 "forms" 12 ] 13 }, 14 "properties": { 15 "forms": { 16 "description": "This tag identifies the embedded card attribute of the capability. This tag is valid only when formsEnabled is set to true. This tag can be left blank by default.", 17 "type": "array", 18 "items": { 19 "type": "object", 20 "uniqueItems": true, 21 "propertyNames": { 22 "enum": [ 23 "name", 24 "description", 25 "src", 26 "uiSyntax", 27 "isDynamic", 28 "window", 29 "colorMode", 30 "formConfigAbility", 31 "formVisibleNotify", 32 "isDefault", 33 "updateEnabled", 34 "scheduledUpdateTime", 35 "updateDuration", 36 "defaultDimension", 37 "supportDimensions", 38 "dataProxyEnabled", 39 "metadata" 40 ] 41 }, 42 "required": [ 43 "name", 44 "isDefault", 45 "supportDimensions", 46 "defaultDimension", 47 "updateEnabled" 48 ], 49 "allOf": [ 50 { 51 "if": { 52 "properties": { 53 "uiSyntax": { 54 "const": "hml" 55 } 56 } 57 }, 58 "then": { 59 "properties": { 60 "isDynamic": { 61 "const": true 62 } 63 } 64 } 65 } 66 ], 67 "properties": { 68 "name": { 69 "description": "Indicates the name of the form class. The tag value is a string of up to 127 bytes. The tag cannot be default.", 70 "type": "string", 71 "maxLength": 127 72 }, 73 "description": { 74 "description": "This tag identifies the description of the form. The tag value can be a string indicating the description content (a string of up to 255 bytes. If the length exceeds 255 bytes, use the resource index mode) or the resource index of the description content to support multiple languages. This tag can be left blank by default.", 75 "type": "string", 76 "maxLength": 255 77 }, 78 "isDefault": { 79 "description": "Indicates whether the card is the default icon. The value is of the Boolean type. The value true indicates that the card is the default card, and the value false indicates that the card is not the default card. Each capability can have only one default card.", 80 "type": "boolean" 81 }, 82 "colorMode": { 83 "description": "This tag identifies the card hue. The value can be auto, dark, or light. dark indicates that the card supports the dark color mode, light indicates that the card does not support the dark color mode, and auto indicates that the card hue is the same as the system hue.", 84 "type": "string", 85 "enum": [ 86 "auto", 87 "dark", 88 "light" 89 ], 90 "default": "auto" 91 }, 92 "supportDimensions": { 93 "description": "This label identifies the card appearance specification. The value is \"1*2\", \" 2*2\", \"2*4\", \"4*4\" and cannot be default. At least one card specification must be specified when defining a card.", 94 "type": "array", 95 "uniqueItems": true, 96 "items": { 97 "type": "string", 98 "enum": [ 99 "1*2", 100 "2*2", 101 "2*4", 102 "4*4" 103 ] 104 } 105 }, 106 "defaultDimension": { 107 "description": "This label identifies the default appearance specifications of the card.", 108 "type": "string", 109 "uniqueItems": true, 110 "enum": [ 111 "1*2", 112 "2*2", 113 "2*4", 114 "4*4" 115 ] 116 }, 117 "updateEnabled": { 118 "description": "Indicates whether the card supports scheduled refresh. The value is of the Boolean type. true indicates that the card supports scheduled vertical refresh, and false indicates that the card does not support scheduled vertical refresh.", 119 "type": "boolean" 120 }, 121 "scheduledUpdateTime": { 122 "description": "Indicates the time when a card is refreshed at a fixed time. The value is counted in 24 hours, accurate to minute. This tag can be set to the default value.", 123 "type": "string", 124 "pattern": "^(([0-1][0-9])|([2][0-3]))[:]+([0-5][0-9])$" 125 }, 126 "updateDuration": { 127 "description": "This tag identifies the update frequency of the card. The unit is 30 minutes. The value is a multiple of 30. The maximum frequency of a card is refreshed every 30 minutes. You can select either refresh or refresh at a fixed point. If both are configured, the card is refreshed at a scheduled time. This label is an integer.", 128 "type": "integer", 129 "minimum": 0 130 }, 131 "dataProxyEnabled": { 132 "description": "Indicates whether the card supports data proxy refresh. The value is of the Boolean type. true indicates that the card supports data proxy refresh, and false indicates that the card does not support data proxy refresh.", 133 "type": "boolean", 134 "default": false 135 }, 136 "metadata": { 137 "description": "Indicates the metadata of the form.", 138 "type": "array", 139 "items": { 140 "type": "object", 141 "propertyNames": { 142 "enum": [ 143 "name", 144 "value", 145 "resource" 146 ] 147 }, 148 "properties": { 149 "name": { 150 "description": "Indicates the key of a data element. The value is a string with a maximum of 255 bytes.", 151 "type": "string", 152 "maxLength": 255 153 }, 154 "value": { 155 "description": "Indicates the value of a data element. The value is a string with a maximum of 255 bytes.", 156 "type": "string", 157 "maxLength": 255 158 }, 159 "resource": { 160 "description": "Indicates the resource of a data element.", 161 "type": "string", 162 "pattern": "^[$]profile:[0-9a-zA-Z_.]+|(?=.*[{])(?=.*[}])[0-9a-zA-Z_.{}]+$", 163 "maxLength": 255 164 } 165 } 166 } 167 }, 168 "formConfigAbility": { 169 "description": "Indicates the name of the facility or activity for card adjustment.", 170 "type": "string", 171 "maxLength": 127, 172 "pattern": "^ability://(.*)$" 173 }, 174 "formVisibleNotify": { 175 "description": "This tag identifies whether the card is allowed to use card visibility notifications.", 176 "type": "boolean", 177 "default": false 178 }, 179 "src": { 180 "description": "Indicates the src of form.", 181 "type": "string" 182 }, 183 "uiSyntax": { 184 "description": "This tag identifies the ui syntax.", 185 "type": "string", 186 "default": "hml", 187 "enum": [ 188 "hml", 189 "arkts" 190 ] 191 }, 192 "isDynamic": { 193 "description": "This tag identifies whether the card is isDynamic.", 194 "type": "boolean", 195 "default": true 196 }, 197 "window": { 198 "description": "Defines window-related configurations. This attribute is not supported by devices running the OHOS.", 199 "type": "object", 200 "propertyNames": { 201 "enum": [ 202 "designWidth", 203 "autoDesignWidth" 204 ] 205 }, 206 "properties": { 207 "designWidth": { 208 "description": "Indicates the baseline width for page design, in pixels. The size of an element is scaled by the actual device width. This label is an integer.", 209 "type": "integer", 210 "minimum": 0 211 }, 212 "autoDesignWidth": { 213 "description": "Specifies whether to automatically calculate the baseline width for page design. If it is set to true, the designWidth attribute becomes invalid. The baseline width is calculated based on the device width and screen density.", 214 "type": "boolean" 215 } 216 } 217 } 218 } 219 } 220 } 221 } 222}