Khattab
08/05/2024, 10:36 AMexpand=properties[$all[properties[$all]]
, but this expand fields for two levels, so we added and extra level to support blocks on third level, but this approach is not maintainable as we cannot predict all the scenarios and the block list fields could be presented in any level, Using V1 expand= all
works fine as it expands all props all the way.
So is there a way to get this to work dynamically, for example a configuration to define couple of field aliases to expand by default or something like that.
Thanks!Khattab
08/05/2024, 11:06 AMRequestContextOutputExpansionStrategyV2.cs
that forceExpandProperties
is set to true
for MapElementProperties
, so is this by design can w e override it?
https://github.com/umbraco/Umbraco-CMS/blob/2736a513a3dd0a29aeac61ace614ff2effdf7135/src/Umbraco.Cms.Api.Delivery/Rendering/RequestContextOutputExpansionStrategyV2.cs#L57RasmusL
11/19/2024, 2:58 PMJacob Overgaard
11/20/2024, 7:46 AMexpand=all
only expanded the first level anyway. With the V2 syntax, you can expand as many levels as you wish, although that is not advisable as that could bottleneck your whole system.
Blocks are the exception, where if the delivery api encounters a block in the output it will be auto-expanded, so you might have seen on V1 that is was your blocks that auto-expanded in the first level and that could have looked like "infinite expanding".
> I see in the RequestContextOutputExpansionStrategyV2.cs that forceExpandProperties is set to true for MapElementProperties, so is this by design can w e override it?
No, not by design. You would have to replace a lot of code to do that.
Can I ask for your use-case to wanting to expand a seemingly infinite level of content? If you know how many levels of containers, rows, columns you have, you can expand that, I suppose?