You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unfortunately, the current SoySauceViewsRenderer implementation provided by micronaut-views does not support custom ij data.
I would be happy to submit a PR but before going further I would like to get feedback from the maintainers regarding the changes.
Currently, SoySauceViewsRenderer retrieves the map returned in the request controller and set it as data in the SoySauce.Renderer renderer instance with setData:
My suggestion is to check if the Map returned by the request controller contains a key called ij. If so, the entry is removed and the value used as injected data (by simply appending entries to the existing ijOverlay Map). Here is a quick implementation overview:
finalObjectijData = context.remove("ij");
if (ijDatainstanceofMap) {
ijOverlay.putAll((Map<? extendsString, ?>) ijData);
} else {
LOG.warn("Skipping invalid ij value. Expected Map but got " + ijData.getClass());
}
What do you think about such a change? would you accept a PR?
The text was updated successfully, but these errors were encountered:
Closure Templates supports injected data, aka ij data:
https://github.com/google/closure-templates/blob/master/documentation/concepts/ij-data.md
Unfortunately, the current
SoySauceViewsRenderer
implementation provided by micronaut-views does not support custom ij data.I would be happy to submit a PR but before going further I would like to get feedback from the maintainers regarding the changes.
Currently,
SoySauceViewsRenderer
retrieves the map returned in the request controller and set it as data in theSoySauce.Renderer
renderer instance withsetData
:micronaut-views/views-soy/src/main/java/io/micronaut/views/soy/SoySauceViewsRenderer.java
Line 134 in a028eed
My suggestion is to check if the Map returned by the request controller contains a key called
ij
. If so, the entry is removed and the value used as injected data (by simply appending entries to the existingijOverlay
Map). Here is a quick implementation overview:What do you think about such a change? would you accept a PR?
The text was updated successfully, but these errors were encountered: