Problem/Motivation
With the webform rest API for entity autocomplete, the autocomplete options are not provided but the /webform_rest/{webform_id}/elements?_format=json endpoint returns an '#options' key for other entity reference elements (ex. entity checkboxes, entity radio, entity select).
Steps to reproduce
To view what the current endpoint offers:
1. Create a webform
2. Add an entity autocomplete element and add a content type
3. Add an entity checkboxes element and add a content type
4. View the API response on /webform_rest/{webform_id}/elements?_format=json
5. You can see that the entity checkboxes object provides '#options' but the entity autocomplete does not. But entity autocomplete does provide a key that has the target bundles
"#selection_settings": {
"target_bundles": {
"article": "article",
"event": "event",
"person": "person",
"place": "place"
}
},Proposed resolution
Create an endpoint on webform_rest to fetch the autocomplete values given the target bundles/content types (ex. article, event, person, place).
Comments
Comment #2
hooroomoo