I've started experimenting with the content delivery API in Umbraco 13 and it works great for the most part. However something I don't quite get is why the Image Media Picker (not with select multiple enabled) gives me an array instead of the object directly?
c
Corné Hoskam
12/20/2023, 12:51 PM
For sake of consistency of the response. The multiple-enabled option is handled in the back-end of Umrbaco, and whether if it's enabled or not best not influence the API response of the same property editor.
Corné Hoskam
12/20/2023, 12:52 PM
You are however able to create a custom implementation of the property editor converter incase whatever you are trying to connect the API to demands it to be an object instead of an array 🙂
s
Sebastian Pierre
12/20/2023, 12:53 PM
Yeah I figured as much, it's not that much of a problem just wanted to know if it was for consistency purposes 🙂
m
mcgern
03/26/2024, 9:44 AM
I've just come across this, wondering why it returns as an array, when the interface explicity states that when the multi option is selected it will return as a ienumerable.
mcgern
03/26/2024, 9:46 AM
Bit new to content delivery api and property editor converters. Would someone be able to point me to the correct docs that show how this is done for v13 please? I only want to target those images that are returning as arrays not object and not affect every other image picker data type.