Home drupal 8 rest api: get allowed values for list field
Reply: 0

drupal 8 rest api: get allowed values for list field

user1154 Published in May 20, 2018, 10:12 am

I am not a drupal dev, and i know next to nothing of php specifically. That said, I am developing a new interface for an existing drupal website and we will continue to use drupal in headless mode using the rest api while we migrate to a better long term solution.

Exposing custom content types be pretty straightforward for the most part, but one aspect is giving me a headache: it seems impossible to expose the list of allowed values in a list field (e.g. list of decimals, integers or text). Ideally, there would be a way to query the drupal api for a given field name, returning a list of possible values for that field.

The closest I've gotten is through the entity rest extra module found here.

but while it exposes a ton of info on the fields, even default value for the list field, the allowed values are not there.

Is there a way to expose the allowed values list in the restful api?

Since the module I found is so close to what I need, would it be easily implemented by custom patching my drupal php code? where should I look for clues?

thanks in advance

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.301829 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO