config_test.schema.yml

Same filename and directory in other branches
  1. 11.x core/modules/config/tests/config_test/config/schema/config_test.schema.yml
  2. 10 core/modules/config/tests/config_test/config/schema/config_test.schema.yml
  3. 9 core/modules/config/tests/config_test/config/schema/config_test.schema.yml
  4. 8.9.x core/modules/config/tests/config_test/config/schema/config_test.schema.yml
core/modules/config/tests/config_test/config/schema/config_test.schema.yml

File

core/modules/config/tests/config_test/config/schema/config_test.schema.yml

View source
  1. # Schema for the configuration files of the Configuration Test module.
  2. config_test_dynamic:
  3. type: config_entity
  4. mapping:
  5. id:
  6. type: string
  7. label: 'ID'
  8. label:
  9. type: label
  10. label: 'Label'
  11. weight:
  12. type: weight
  13. label: 'Weight'
  14. style:
  15. type: string
  16. label: 'style'
  17. size:
  18. type: string
  19. label: 'Size'
  20. size_value:
  21. type: string
  22. label: 'Size value'
  23. protected_property:
  24. type: string
  25. label: 'Protected property'
  26. array_property:
  27. type: ignore
  28. label: 'Array property'
  29. config_test.dynamic.*:
  30. type: config_test_dynamic
  31. label: 'Config test dynamic settings'
  32. config_test.dynamic.*.*:
  33. type: config_test_dynamic
  34. label: 'Config test dynamic settings'
  35. config_test.dynamic.*.third_party.node:
  36. type: mapping
  37. mapping:
  38. foo:
  39. type: string
  40. config_test.query.*:
  41. type: config_entity
  42. mapping:
  43. id:
  44. type: string
  45. label: 'ID'
  46. label:
  47. type: label
  48. label: 'Label'
  49. array:
  50. type: sequence
  51. label: 'Array level 1'
  52. sequence:
  53. type: sequence
  54. label: 'Array level 2'
  55. sequence:
  56. type: integer
  57. label: 'Value'
  58. number:
  59. type: integer
  60. label: 'number'
  61. config_test.types:
  62. type: config_object
  63. label: 'Configuration type'
  64. mapping:
  65. array:
  66. type: sequence
  67. label: 'Array'
  68. sequence:
  69. type: string
  70. label: 'Item'
  71. boolean:
  72. type: boolean
  73. label: 'Boolean'
  74. exp:
  75. type: float
  76. label: 'Exponential'
  77. float:
  78. type: float
  79. label: 'Float'
  80. float_as_integer:
  81. type: float
  82. label: 'Float'
  83. hex:
  84. type: integer
  85. label: 'Hexadecimal'
  86. int:
  87. type: integer
  88. label: 'Integer'
  89. octal:
  90. # Symfony 5.1's YAML parser issues a deprecation when reading octal with a
  91. # leading zero, to comply with YAML 1.2. However PECL YAML is still YAML 1.1
  92. # compliant.
  93. # @see core/modules/config/tests/config_test/config/install/config_test.types.yml
  94. # @see \Drupal\KernelTests\Core\Config\ConfigCRUDTest::testDataTypes()
  95. # @todo Mark as required again in https://www.drupal.org/project/drupal/issues/3205480
  96. requiredKey: false
  97. type: integer
  98. label: 'Octal'
  99. string:
  100. type: string
  101. label: 'String'
  102. string_int:
  103. type: string
  104. label: 'String integer'
  105. # All the above types, but now nullable.
  106. nullable_array:
  107. type: sequence
  108. label: 'Nullable array'
  109. nullable: true
  110. sequence:
  111. type: string
  112. label: 'Item'
  113. nullable_boolean:
  114. type: boolean
  115. label: 'Nullable boolean'
  116. nullable: true
  117. nullable_exp:
  118. type: float
  119. label: 'Nullable exponential'
  120. nullable: true
  121. nullable_float:
  122. type: float
  123. label: 'Nullable float'
  124. nullable: true
  125. nullable_float_as_integer:
  126. type: float
  127. label: 'Float'
  128. nullable: true
  129. nullable_hex:
  130. type: integer
  131. label: 'Nullable hexadecimal'
  132. nullable: true
  133. nullable_int:
  134. type: integer
  135. label: 'Nullable integer'
  136. nullable: true
  137. nullable_octal:
  138. type: integer
  139. label: 'Nullable octal'
  140. nullable: true
  141. nullable_string:
  142. type: string
  143. label: 'Nullable string'
  144. nullable: true
  145. nullable_string_int:
  146. type: string
  147. label: 'Nullable string integer'
  148. nullable: true
  149. # To test required vs optional keys.
  150. mapping_with_only_required_keys:
  151. type: mapping
  152. label: 'Mapping with only required keys'
  153. mapping:
  154. north: { type: string }
  155. east: { type: string }
  156. south: { type: string }
  157. west: { type: string }
  158. mapping_with_some_required_keys:
  159. type: mapping
  160. label: 'Mapping with only required keys'
  161. mapping:
  162. north: { type: string }
  163. east: { type: string, requiredKey: false }
  164. south: { type: string }
  165. west: { type: string, requiredKey: false }
  166. mapping_with_only_optional_keys:
  167. type: mapping
  168. label: 'Mapping with only optional keys'
  169. mapping:
  170. north: { type: string, requiredKey: false }
  171. east: { type: string, requiredKey: false }
  172. south: { type: string, requiredKey: false }
  173. west: { type: string, requiredKey: false }
  174. config_test.types.fully_validatable:
  175. type: config_test.types
  176. constraints:
  177. FullyValidatable: ~
  178. config_test.no_status.default:
  179. type: config_object
  180. label: 'Configuration no status default'
  181. mapping:
  182. id:
  183. type: string
  184. label: 'ID'
  185. label:
  186. type: label
  187. label: 'Label'
  188. uuid:
  189. type: string
  190. label: 'UUID'
  191. config_test.system:
  192. type: config_object
  193. label: 'Configuration system'
  194. mapping:
  195. foo:
  196. type: string
  197. label: 'Foo'
  198. baz:
  199. type: string
  200. label: 'Baz'
  201. '404':
  202. type: string
  203. label: '404'
  204. config_test.new:
  205. type: config_object
  206. label: 'Configuration test'
  207. mapping:
  208. key:
  209. type: string
  210. label: 'Test setting'
  211. new_key:
  212. type: string
  213. label: 'Test setting'
  214. uuid:
  215. type: uuid
  216. config_test.old:
  217. type: config_test.new
  218. config_test.foo:
  219. type: config_object
  220. label: 'Configuration test'
  221. mapping:
  222. value:
  223. type: mapping
  224. label: 'Value'
  225. mapping:
  226. key:
  227. type: string
  228. label: 'Key'
  229. label:
  230. type: label
  231. label: 'Label'
  232. # Note that config_object should never be used on a non-root key.
  233. broken_langcode_required:
  234. type: config_object
  235. required: false
  236. mapping:
  237. foo:
  238. type: string
  239. config_test.bar:
  240. type: config_test.foo
  241. system.action.*.third_party.config_test:
  242. type: mapping
  243. label: 'Third party setting for action entity'
  244. mapping:
  245. integer:
  246. type: integer
  247. label: 'Integer'
  248. config_test.validation:
  249. type: config_object
  250. label: 'Configuration type'
  251. constraints:
  252. AtLeastOneOf:
  253. messageCollection: 'Either block_id and block_revision_id, or block_serialized must be provided.'
  254. constraints:
  255. - MappingCollection:
  256. allowExtraFields: true
  257. allowMissingFields: false
  258. fields:
  259. block_id:
  260. Required:
  261. constraints:
  262. - NotNull: {}
  263. - NotBlank: {}
  264. block_revision_id:
  265. Required:
  266. constraints:
  267. - NotNull: {}
  268. - NotBlank: {}
  269. block_serialized:
  270. Optional: {}
  271. - MappingCollection:
  272. allowExtraFields: true
  273. allowMissingFields: false
  274. fields:
  275. block_id:
  276. Optional: {}
  277. block_revision_id:
  278. Optional: {}
  279. block_serialized:
  280. Required:
  281. constraints:
  282. - Serialized: []
  283. - NotNull: {}
  284. - NotBlank: {}
  285. Callback:
  286. callback: [\Drupal\config_test\ConfigValidation, validateMapping]
  287. mapping:
  288. llama:
  289. type: string
  290. constraints:
  291. Callback:
  292. callback: [\Drupal\config_test\ConfigValidation, validateLlama]
  293. cat:
  294. type: mapping
  295. constraints:
  296. NotBlank: {}
  297. NotNull: {}
  298. AtLeastOneOf:
  299. constraints:
  300. - NotBlank: {}
  301. - NotNull: {}
  302. mapping:
  303. type:
  304. type: string
  305. constraints:
  306. Callback:
  307. callback: [\Drupal\config_test\ConfigValidation, validateCats]
  308. count:
  309. type: integer
  310. constraints:
  311. Callback:
  312. callback: [\Drupal\config_test\ConfigValidation, validateCatCount]
  313. giraffe:
  314. type: sequence
  315. constraints:
  316. Callback:
  317. callback: [\Drupal\config_test\ConfigValidation, validateSequence]
  318. sequence:
  319. type: string
  320. constraints:
  321. Callback:
  322. callback: [\Drupal\config_test\ConfigValidation, validateGiraffes]
  323. uuid:
  324. type: uuid
  325. # @see \Drupal\KernelTests\Config\TypedConfigTest::testNotBlankInteractionWithNotNull()
  326. string__not_blank:
  327. type: string
  328. constraints:
  329. NotBlank: {}
  330. host:
  331. type: string
  332. constraints:
  333. UriHost: ~
  334. block_id:
  335. type: integer
  336. label: 'Block ID'
  337. nullable: true
  338. constraints:
  339. Range:
  340. min: 1
  341. block_revision_id:
  342. type: integer
  343. label: 'Block revision ID'
  344. nullable: true
  345. constraints:
  346. Range:
  347. min: 1
  348. block_serialized:
  349. type: string
  350. label: 'Serialized block'
  351. nullable: true
  352. constraints:
  353. Serialized: []
  354. composite:
  355. type: mapping
  356. nullable: true
  357. mapping:
  358. sequentially:
  359. required: false
  360. type: string
  361. constraints:
  362. Sequentially:
  363. constraints:
  364. - NotBlank: []
  365. - Length:
  366. min: 1
  367. max: 10
  368. at_least_one_of:
  369. required: false
  370. type: string
  371. constraints:
  372. AtLeastOneOf:
  373. constraints:
  374. - Range:
  375. min: 0
  376. max: 10
  377. - Range:
  378. min: 20
  379. max: 30
  380. nested:
  381. required: false
  382. type: string
  383. constraints:
  384. Sequentially:
  385. constraints:
  386. - NotBlank: []
  387. - AtLeastOneOf:
  388. constraints:
  389. - Length:
  390. min: 1
  391. max: 10
  392. - Length:
  393. min: 20
  394. max: 30
  395. string_concat_value_1:
  396. type: string
  397. label: 'String part 1'
  398. string_concat_value_2:
  399. type: string
  400. label: 'String part 2'
  401. string_concat_values:
  402. type: string
  403. label: 'String parts'
  404. constraints:
  405. StringEqualsConcatenatedValues:
  406. separator: .
  407. reservedCharacters:
  408. - '|'
  409. reservedCharactersSubstitute: '>'
  410. values:
  411. - '%parent.string_concat_value_1'
  412. - '%parent.string_concat_value_2'
  413. string_concat_values_invalid:
  414. type: string
  415. nullable: true
  416. constraints:
  417. StringEqualsConcatenatedValues:
  418. separator: .
  419. values:
  420. - '%parent.invalid'
  421. - '%parent.reference'
  422. config_test.string_concat_values_invalid:
  423. type: config_object
  424. label: 'Configuration type'
  425. constraints:
  426. Callback:
  427. callback: [\Drupal\config_test\ConfigValidation, validateMapping]
  428. mapping:
  429. string_concat_values_invalid:
  430. type: string
  431. nullable: true
  432. constraints:
  433. StringEqualsConcatenatedValues:
  434. separator: .
  435. values:
  436. - '%parent.host'
  437. - '%parent.green'
  438. config_test.with_plural_label:
  439. type: config_object
  440. mapping:
  441. label:
  442. type: plural_label

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.