Rest API: Evaluation of a metadata type property

Requests for new functionality or improvements in existing functionality. Please provide clear descriptions of your request, an example or if possible a real life scenario.
Post Reply
qra
Posts: 30
Joined: Fri Oct 25, 2019 9:08 pm

Rest API: Evaluation of a metadata type property

Post by qra »

Hello. Rest API function /api/metadata_types/<pk>/ returns (among others) definition of the "Lockup" property (eg "{{ users }}"). Could you consider adding an evaluated value for this property (a comma delimited string, such as "admin, bob, mary, garry")?


For example

Code: Select all

Request URL:
http://127.0.0.1/api/metadata_types/5/

Response body:
{
  "default": null,
  "id": 5,
  "label": "User",
  "lookup": "{{ users }}",
  "evaluated_lookup": "admin, bob, mary, garry",
  "name": "meta_usr",
  "parser": "",
  "url": "http://127.0.0.1/api/metadata_types/5/",
  "validation": ""
}
User avatar
rosarior
Developer
Developer
Posts: 651
Joined: Tue Aug 21, 2018 3:28 am
Location: Puerto Rico
Contact:

Re: Rest API: Evaluation of a metadata type property

Post by rosarior »

Hi,

thanks for the suggestion. We'll take a look to see if this is possible.

One downside is that the evaluation will have be done upon the GET HTTP request. This is usually not a good idea. Another concern would be security. We need to figure out if the user editing or viewing the metadata type should also be able to see the results of the template as they can show data from other apps for which the user might not have access to.

Your idea has been queued and will discuss it.

Thanks!
Post Reply