Configuration entity properties to export can now be determined by the config_export annotation property. Previously the configuration entity's schema was used to do this.
The ConfigEntityBase properties uuid, langcode, status, dependencies, and third_party_settings are added by default.
Example configuration entity annotation including the config_export property:
/**
* Defines the Date Format configuration entity class.
*
* @ConfigEntityType(
* id = "date_format",
* label = @Translation("Date format"),
* handlers = {
* "access" = "Drupal\system\DateFormatAccessControlHandler",
* },
* entity_keys = {
* "id" = "id",
* "label" = "label"
* },
* admin_permission = "administer site configuration",
* list_cache_tags = { "rendered" },
* config_export = {
* "id",
* "label",
* "locked",
* "pattern",
* }
* )
*/
If the annotation is not present, configuration schema is planned to be (work in progress, see #2483407: Allow configuration schema fallback in ConfigEntityType::getPropertiesToExport() to work without an ID) used as a fallback mechanism. Note that using schema is not performant. If the configuration entity has to converted to an array as part of cold cache response then using the annotation is highly recommended.
Additionally the config_export can map camel case class properties to snake case config keys. For example:
* config_export = {
* "myProperty" = "my_property",
* }