I think it would be helpful to expose the field storage configuration also as part of API, so that API consumer can be aware of storage specific configs like cardinality, options for select list.

Proposed Solution:
in src/Plugin/rest/resource/EntityBundleFieldsResource.php
- $fields[$field_instance->getName()] = $field_instance;
+ $field_storage = $field_instance->getFieldStorageDefinition();
+ $fields[$field_instance->getName()]['field_config'] = $field_instance;
+ $fields[$field_instance->getName()]['field_storage'] = $field_storage;

CommentFileSizeAuthor
#3 2880270-get_field_storage_config-2.patch828 bytesarpitr

Comments

arpitr created an issue. See original summary.

arpitr’s picture

Title: Expose field cardinality in API » Expose field storage in API
Issue summary: View changes
arpitr’s picture

Status: Active » Needs review
StatusFileSize
new828 bytes
-enzo-’s picture

Hi @arpitr

Could you provide a comparison of output without and with the patch.

Kind regards,

geoanders’s picture

Version: 8.x-1.x-dev » 8.x-2.x-dev
geoanders’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.