core.data_types.schema.yml 17.5 KB
Newer Older
1 2
# Base types provided by Drupal core.

3
# Read https://www.drupal.org/node/1905070 for more details about configuration
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
# schema, types and type resolution.

# Undefined type used by the system to assign to elements at any level where
# configuration schema is not defined. Using explicitly has the same effect as
# not defining schema, so there is no point in doing that.
undefined:
  label: 'Undefined'
  class: '\Drupal\Core\Config\Schema\Undefined'

# Explicit type to use when no data typing is possible. Instead of using this
# type, we strongly suggest you use configuration structures that can be
# described with other structural elements of schema, and describe your schema
# with those elements.
ignore:
  label: 'Ignore'
  class: '\Drupal\Core\Config\Schema\Ignore'

21 22 23
# Basic scalar data types from typed data.
boolean:
  label: 'Boolean'
24
  class: '\Drupal\Core\TypedData\Plugin\DataType\BooleanData'
25 26
email:
  label: 'Email'
27
  class: '\Drupal\Core\TypedData\Plugin\DataType\Email'
28 29
integer:
  label: 'Integer'
30
  class: '\Drupal\Core\TypedData\Plugin\DataType\IntegerData'
31 32 33
timestamp:
  label: 'Timestamp'
  class: '\Drupal\Core\TypedData\Plugin\DataType\Timestamp'
34 35
float:
  label: 'Float'
36
  class: '\Drupal\Core\TypedData\Plugin\DataType\FloatData'
37 38
string:
  label: 'String'
39
  class: '\Drupal\Core\TypedData\Plugin\DataType\StringData'
40 41
uri:
  label: 'Uri'
42
  class: '\Drupal\Core\TypedData\Plugin\DataType\Uri'
43

44
# Container data types for lists with known and unknown keys.
45 46 47
mapping:
  label: Mapping
  class: '\Drupal\Core\Config\Schema\Mapping'
48
  definition_class: '\Drupal\Core\TypedData\MapDataDefinition'
49 50 51
sequence:
  label: Sequence
  class: '\Drupal\Core\Config\Schema\Sequence'
52
  definition_class: '\Drupal\Core\Config\Schema\SequenceDataDefinition'
53 54 55 56 57 58 59

# Simple extended data types:

# Human readable string that must be plain text and editable with a text field.
label:
  type: string
  label: 'Label'
60
  translatable: true
61

62 63 64 65 66
# String containing plural variants, separated by EXT.
plural_label:
  type: label
  label: 'Plural variants'

67 68 69 70 71 72 73 74 75
# Internal Drupal path
path:
  type: string
  label: 'Path'

# Human readable string that can contain multiple lines of text or HTML.
text:
  type: string
  label: 'Text'
76
  translatable: true
77

78 79 80 81 82 83 84
# A UUID.
uuid:
  type: string
  label: 'UUID'
  constraints:
    Uuid: {}

85 86 87
# PHP Date format string that is translatable.
date_format:
  type: string
88
  label: 'Date format'
89
  translatable: true
90
  translation context: 'PHP date format'
91

92 93 94 95 96
# HTML color value.
color_hex:
  type: string
  label: 'Color'

97 98
# Complex extended data types:

99
# Root of a configuration object.
100 101 102 103 104 105 106 107

_core_config_info:
  type: mapping
  mapping:
    default_config_hash:
      type: string
      label: 'Default configuration hash'

108 109 110 111 112 113
config_object:
  type: mapping
  mapping:
    langcode:
      type: string
      label: 'Language code'
114 115
    _core:
      type: _core_config_info
116

117 118 119
# Mail text with subject and body parts.
mail:
  type: mapping
120
  label: 'Mail'
121
  mapping:
122 123 124 125
    subject:
      type: label
      label: 'Subject'
    body:
126
      type: text
127
      label: 'Body'
128 129 130 131 132 133

# Filter with module and status.
filter:
  type: mapping
  label: 'Filter'
  mapping:
134
    id:
135
      type: string
136 137 138 139
      label: 'ID'
    provider:
      type: string
      label: 'Provider'
140 141
    status:
      type: boolean
142 143 144 145 146 147 148 149 150 151 152 153
      label: 'Status'
    weight:
      type: integer
      label: 'Weight'
    settings:
      type: filter_settings.[%parent.id]

# System action configuration base.
action_configuration_default:
  type: sequence
  label: 'Action configuration'
  sequence:
154
    type: string
155

156
theme_settings:
157
  type: config_object
158
  mapping:
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176
    favicon:
      type: mapping
      label: 'Shortcut icon settings'
      mapping:
        mimetype:
          type: string
          label: 'MIME type'
        path:
          type: string
          label: 'Path'
        url:
          type: string
          label: 'URL'
        use_default:
          type: boolean
          label: 'Use the default shortcut icon supplied by the theme'
    features:
      type: mapping
177
      label: 'Optional features'
178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201
      mapping:
        comment_user_picture:
          type: boolean
          label: 'User pictures in comments'
        comment_user_verification:
          type: boolean
          label: 'User verification status in comments'
        favicon:
          type: boolean
          label: 'Shortcut icon'
        logo:
          type: boolean
          label: 'Logo'
        name:
          type: boolean
          label: 'Site name'
        node_user_picture:
          type: boolean
          label: 'User pictures in posts'
        slogan:
          type: boolean
          label: 'Site slogan'
    logo:
      type: mapping
202
      label: 'Logo settings'
203 204 205 206 207 208 209 210 211 212
      mapping:
        path:
          type: string
          label: 'Logo path'
        url:
          type: uri
          label: 'URL'
        use_default:
          type: boolean
          label: 'Use default'
213 214 215 216
    third_party_settings:
      type: sequence
      label: 'Third party settings'
      sequence:
217
        type: theme_settings.third_party.[%key]
218

219 220 221 222 223 224
# Array of routes with route_name and route_params keys.
route:
  type: mapping
  label: 'Route'
  mapping:
    route_name:
225
      type: string
226 227 228 229 230
      label: 'Route Name'
    route_params:
      type: sequence
      label: 'Route Params'
      sequence:
231 232
        type: string
        label: 'Param'
233 234

# Config dependencies.
235
config_dependencies_base:
236 237
  type: mapping
  mapping:
238
    config:
239
      type: sequence
240 241
      label: 'Configuration entity dependencies'
      sequence:
242
        type: string
243 244 245
    content:
      type: sequence
      label: 'Content entity dependencies'
246
      sequence:
247
        type: string
248 249 250 251
    module:
      type: sequence
      label: 'Module dependencies'
      sequence:
252
        type: string
253 254 255 256
    theme:
      type: sequence
      label: 'Theme dependencies'
      sequence:
257
        type: string
258

259 260 261 262 263 264 265 266
config_dependencies:
  type: config_dependencies_base
  label: 'Configuration dependencies'
  mapping:
    enforced:
      type: config_dependencies_base
      label: 'Enforced configuration dependencies'

267 268 269 270
config_entity:
  type: mapping
  mapping:
    uuid:
271
      type: uuid
272 273 274
      label: 'UUID'
    langcode:
      type: string
275
      label: 'Language code'
276 277 278 279 280 281
    status:
      type: boolean
      label: 'Status'
    dependencies:
      type: config_dependencies
      label: 'Dependencies'
282 283 284 285
    third_party_settings:
      type: sequence
      label: 'Third party settings'
      sequence:
286
        type: '[%parent.%parent.%type].third_party.[%key]'
287 288
    _core:
      type: _core_config_info
289

290 291 292
block.settings.*:
  type: block_settings

293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317
block_settings:
  type: mapping
  label: 'Block settings'
  mapping:
    id:
      type: string
      label: 'ID'
    label:
      type: label
      label: 'Description'
    label_display:
      type: string
      label: 'Display title'
    status:
      type: boolean
      label: 'Status'
    info:
      type: label
      label: 'Admin info'
    view_mode:
      type: string
      label: 'View mode'
    provider:
      type: string
      label: 'Provider'
318 319 320 321 322
    context_mapping:
      type: sequence
      label: 'Context assignments'
      sequence:
        type: string
323 324 325 326 327 328 329 330 331 332 333

condition.plugin:
  type: mapping
  label: 'Condition'
  mapping:
    id:
      type: string
      label: 'ID'
    negate:
      type: boolean
      label: 'Negate'
334
    uuid:
335
      type: uuid
336 337 338 339
    context_mapping:
      type: sequence
      label: 'Context assignments'
      sequence:
340
        type: string
341 342 343 344 345 346 347 348 349 350 351 352 353 354 355

display_variant.plugin:
  type: mapping
  label: 'Display variant'
  mapping:
    id:
      type: string
      label: 'ID'
    label:
      type: label
      label: 'Label'
    weight:
      type: integer
      label: 'Weight'
    uuid:
356
      type: uuid
357

358 359 360 361 362 363 364
layout_plugin.settings:
  type: mapping
  label: 'Layout settings'

layout_plugin.settings.*:
  type: layout_plugin.settings

365 366 367 368 369 370
base_entity_reference_field_settings:
  type: mapping
  mapping:
    target_type:
      type: string
      label: 'Type of item to reference'
371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399

field_config_base:
  type: config_entity
  mapping:
    id:
      type: string
      label: 'ID'
    field_name:
      type: string
      label: 'Field name'
    entity_type:
      type: string
      label: 'Entity type'
    bundle:
      type: string
      label: 'Bundle'
    label:
      type: label
      label: 'Label'
    description:
      type: text
      label: 'Help text'
    required:
      type: boolean
      label: 'Required field'
    translatable:
      type: boolean
      label: 'Translatable'
    default_value:
400 401 402
      type: sequence
      label: 'Default values'
      sequence:
403 404
        type: field.value.[%parent.%parent.field_type]
        label: 'Default value'
405
    default_value_callback:
406
      type: string
407
      label: 'Default value callback'
408
    settings:
409
      type: field.field_settings.[%parent.field_type]
410 411 412 413 414 415 416
    field_type:
      type: string
      label: 'Field type'

core.base_field_override.*.*.*:
  type: field_config_base
  label: 'Base field bundle override'
417

418 419 420 421 422 423 424 425 426 427 428 429 430 431
core.date_format.*:
  type: config_entity
  label: 'Date format'
  mapping:
    id:
      type: string
      label: 'ID'
    label:
      type: label
      label: 'Label'
    locked:
      type: boolean
      label: 'Locked'
    pattern:
432
      type: core_date_format_pattern.[%parent.locked]
433 434
      label: 'PHP date format'

435 436 437 438 439 440 441 442 443 444
# Unlocked date formats should use the translatable type.
core_date_format_pattern.0:
  type: date_format
  label: 'Date format'

# Locked date formats are just used to transport the value.
core_date_format_pattern.1:
  type: string
  label: 'Date format'

445 446 447 448 449 450 451 452 453 454 455 456 457 458
# Generic field settings schemas.

field.storage_settings.*:
  type: mapping
  label: 'Settings'

field.field_settings.*:
  type: mapping
  label: 'Settings'

field.value.*:
  type: mapping
  label: 'Default value'

459 460
# Schema for the configuration of the String field type.

461
field.storage_settings.string:
462 463 464 465 466 467
  type: mapping
  label: 'String settings'
  mapping:
    max_length:
      type: integer
      label: 'Maximum length'
468 469 470
    case_sensitive:
      type: boolean
      label: 'Case sensitive'
471 472 473
    is_ascii:
      type: boolean
      label: 'Contains US ASCII characters only'
474

475 476
field.field_settings.string:
  type: mapping
477 478
  label: 'String settings'

479 480
field.value.string:
  type: mapping
481
  label: 'Default value'
482 483
  mapping:
    value:
484
      type: label
485
      label: 'Value'
486

487 488
# Schema for the configuration of the  String (long) field type.

489
field.storage_settings.string_long:
490
  type: mapping
491
  label: 'String (long) settings'
492 493 494 495
  mapping:
    case_sensitive:
      type: boolean
      label: 'Case sensitive'
496

497
field.field_settings.string_long:
498
  type: mapping
499 500
  label: 'String (long) settings'

501 502
field.value.string_long:
  type: mapping
503
  label: 'Default value'
504 505 506 507
  mapping:
    value:
      type: text
      label: 'Value'
508 509 510

# Schema for the configuration of the URI field type.

511
field.storage_settings.uri:
512
  type: field.storage_settings.string
513 514 515 516 517
  label: 'URI settings'
  mapping:
    max_length:
      type: integer
      label: 'Maximum length'
518 519 520
    case_sensitive:
      type: boolean
      label: 'Case sensitive'
521

522 523
field.field_settings.uri:
  type: mapping
524 525
  label: 'URI settings'

526 527
field.value.uri:
  type: mapping
528
  label: 'Default value'
529 530 531 532
  mapping:
    value:
      type: string
      label: 'Value'
533 534 535

# Schema for the configuration of the Created field type.

536 537
field.storage_settings.created:
  type: mapping
538 539
  label: 'Created timestamp settings'

540 541
field.field_settings.created:
  type: mapping
542 543
  label: 'Created timestamp settings'

544 545
field.value.created:
  type: mapping
546
  label: 'Default value'
547 548 549 550
  mapping:
    value:
      type: integer
      label: 'Value'
551 552 553

# Schema for the configuration of the Changed field type.

554 555
field.storage_settings.changed:
  type: mapping
556 557
  label: 'Changed timestamp settings'

558 559
field.field_settings.changed:
  type: mapping
560 561
  label: 'Changed timestamp settings'

562 563
field.value.changed:
  type: mapping
564
  label: 'Default value'
565 566 567 568
  mapping:
    value:
      type: integer
      label: 'Value'
569 570 571

# Schema for the configuration of the Entity reference field type.

572
field.storage_settings.entity_reference:
573
  type: mapping
574
  label: 'Entity reference field storage settings'
575 576 577 578 579
  mapping:
    target_type:
      type: string
      label: 'Type of item to reference'

580
field.field_settings.entity_reference:
581
  type: mapping
582
  label: 'Entity reference field settings'
583 584 585 586 587
  mapping:
    handler:
      type: string
      label: 'Reference method'
    handler_settings:
588 589
      type: entity_reference_selection.[%parent.handler]
      label: 'Entity reference selection plugin settings'
590

591 592
field.value.entity_reference:
  type: mapping
593
  label: 'Default value'
594 595 596 597 598
  mapping:
    target_id:
      type: string
      label: 'Value'
    target_uuid:
599
      type: uuid
600 601

# Schema for the configuration of the Boolean field type.
602

603
field.field_settings.boolean:
604
  label: 'Boolean settings'
605
  type: mapping
606 607
  mapping:
    on_label:
608
      type: label
609 610
      label: 'On label'
    off_label:
611
      type: label
612 613
      label: 'Off label'

614 615 616 617 618 619
field.value.boolean:
  type: mapping
  mapping:
    value:
      type: integer
      label: 'Value'
620

621
# Schema for the configuration of the Email field type.
622

623 624
field.storage_settings.email:
  type: mapping
625 626
  label: 'Email settings'

627 628
field.field_settings.email:
  type: mapping
629 630
  label: 'Email settings'
  sequence:
631 632
    type: string
    label: 'Setting'
633

634 635
field.value.email:
  type: mapping
636
  label: 'Default value'
637 638 639 640
  mapping:
    value:
      type: email
      label: 'Value'
641

642
# Schema for the configuration of the Integer field type.
643

644
field.storage_settings.integer:
645
  type: mapping
646
  label: 'Integer settings'
647 648 649 650 651 652 653
  mapping:
    unsigned:
      type: boolean
      label: 'Unsigned'
    size:
      type: string
      label: 'Database storage size'
654

655
field.field_settings.integer:
656 657 658 659 660 661 662 663 664 665
  type: mapping
  label: 'Integer'
  mapping:
    min:
      type: integer
      label: 'Minimum'
    max:
      type: integer
      label: 'Maximum'
    prefix:
666
      type: label
667 668
      label: 'Prefix'
    suffix:
669
      type: label
670 671
      label: 'Suffix'

672 673
field.value.integer:
  type: mapping
674
  label: 'Default value'
675 676 677 678
  mapping:
    value:
      type: integer
      label: 'Value'
679

680 681
# Schema for the configuration of the Decimal field type.

682
field.storage_settings.decimal:
683 684 685 686 687 688 689 690 691 692
  type: mapping
  label: 'Decimal settings'
  mapping:
    precision:
      type: integer
      label: 'Precision'
    scale:
      type: integer
      label: 'Scale'

693
field.field_settings.decimal:
694
  type: mapping
695
  label: 'Decimal settings'
696 697 698 699 700 701 702 703
  mapping:
    min:
      type: float
      label: 'Minimum'
    max:
      type: float
      label: 'Maximum'
    prefix:
704
      type: label
705 706
      label: 'Prefix'
    suffix:
707
      type: label
708 709
      label: 'Suffix'

710 711
field.value.decimal:
   type: mapping
712
   label: 'Default value'
713 714 715 716
   mapping:
     value:
       type: float
       label: 'Value'
717

718 719
# Schema for the configuration of the Float field type.

720 721
field.storage_settings.float:
  type: mapping
722 723
  label: 'Float settings'

724
field.field_settings.float:
725
  type: mapping
726
  label: 'Float settings'
727 728 729 730 731 732 733 734
  mapping:
    min:
      type: float
      label: 'Minimum'
    max:
      type: float
      label: 'Maximum'
    prefix:
735
      type: label
736 737
      label: 'Prefix'
    suffix:
738
      type: label
739 740
      label: 'Suffix'

741 742
field.value.float:
  type: mapping
743
  label: 'Default value'
744 745 746 747
  mapping:
    value:
      type: float
      label: 'Value'
748

749 750 751 752 753 754 755 756 757 758
# Schema for the configuration of the Timestamp field type.

field.value.timestamp:
  type: mapping
  label: 'Timestamp value'
  mapping:
    value:
      type: timestamp
      label: 'Value'

759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780
# Text with a text format.
text_format:
  type: mapping
  label: 'Text with text format'
  # We declare the entire mapping of text and text format as translatable. This
  # causes the entire mapping to be saved to the language overrides of the
  # configuration. Storing only the (to be formatted) text could result in
  # security problems in case the text format of the source text is changed.
  translatable: true
  mapping:
    value:
      type: text
      label: 'Text'
      # Mark the actual text as translatable (in addition to the entire mapping
      # being marked as translatable) so that shipped configuration with
      # formatted text can participate in the string translation system.
      translatable: true
    format:
      type: string
      label: 'Text format'
      # The text format should not be translated as part of the string
      # translation system, so this is not marked as translatable.
781

782
# Base schema for all entity reference selection handler schemas.
783 784
entity_reference_selection:
  type: mapping
785 786 787 788 789 790 791 792 793 794 795 796 797 798 799
  label: 'Entity reference selection handler settings'
  mapping:
    target_type:
      type: string
      label: 'Type of item to reference'

# Schema for all entity reference selection handlers that are not providing a
# specific schema.
entity_reference_selection.*:
  type: entity_reference_selection

# Schema for the entity reference 'default' selection handler settings.
entity_reference_selection.default:
  type: entity_reference_selection
  label: 'Default selection handler settings'
800 801 802 803
  mapping:
    target_bundles:
      type: sequence
      label: 'types'
804
      nullable: true
805 806
      sequence:
        type: string
807
        label: 'Bundle'
808 809 810 811 812 813 814 815 816 817 818 819 820
    sort:
      type: mapping
      label: 'Sort settings'
      mapping:
        field:
          type: string
          label: 'Sort by'
        direction:
          type: string
          label: 'Sort direction'
    auto_create:
      type: boolean
      label: 'Create referenced entities if they don''t already exist'
821 822 823
    auto_create_bundle:
      type: string
      label: 'Bundle assigned to the auto-created entities.'
824

825 826 827 828
# Schema for all entity reference 'default:*' selection handlers that are not
# providing a specific schema.
entity_reference_selection.default:*:
  type: entity_reference_selection.default