Github user neykov commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/949#discussion_r42222707
  
    --- Diff: 
usage/jsgui/src/main/webapp/assets/js/view/application-add-wizard.js ---
    @@ -85,6 +85,13 @@ define([
             if (entity.config && _.size(entity.config)) 
result["brooklyn.config"] = entity.config;
             return result;
         }
    +    function getConvertedConfigValue(value) {
    +        try {
    +            return $.parseJSON(value);
    +        } catch (e) {
    +            return value;
    --- End diff --
    
    You'll hit a problem if you have ConfigKey<String> ITEMS, but pass an array 
([1, 2, 3, 4]). In this case:
      * the client will pass the array as is to the server (not escaping it)
      * the YAML parser will deserialize it to an array
      * when the user does config().get(ITEMS) Brooklyn will try to convert 
from an array to a string, calling toString on the object which is not clear 
whether will lead to the original string or not. In the worst case it will be 
completely invalid value (i.e. object@adfh34ur), in the best it will still be a 
parseable array, but won't match the original string, leading to unexpected 
results.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to