config_test.schema.yml

Same filename in other branches
  1. 9 core/modules/config/tests/config_test/config/schema/config_test.schema.yml
  2. 8.9.x core/modules/config/tests/config_test/config/schema/config_test.schema.yml
  3. 10 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. Callback:
  253. callback: [\Drupal\config_test\ConfigValidation, validateMapping]
  254. mapping:
  255. llama:
  256. type: string
  257. constraints:
  258. Callback:
  259. callback: [\Drupal\config_test\ConfigValidation, validateLlama]
  260. cat:
  261. type: mapping
  262. mapping:
  263. type:
  264. type: string
  265. constraints:
  266. Callback:
  267. callback: [\Drupal\config_test\ConfigValidation, validateCats]
  268. count:
  269. type: integer
  270. constraints:
  271. Callback:
  272. callback: [\Drupal\config_test\ConfigValidation, validateCatCount]
  273. giraffe:
  274. type: sequence
  275. constraints:
  276. Callback:
  277. callback: [\Drupal\config_test\ConfigValidation, validateSequence]
  278. sequence:
  279. type: string
  280. constraints:
  281. Callback:
  282. callback: [\Drupal\config_test\ConfigValidation, validateGiraffes]
  283. uuid:
  284. type: uuid
  285. # @see \Drupal\KernelTests\Config\TypedConfigTest::testNotBlankInteractionWithNotNull()
  286. string__not_blank:
  287. type: string
  288. constraints:
  289. NotBlank: {}
  290. host:
  291. type: string
  292. constraints:
  293. UriHost: ~

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