Literal { (left curly bracket) cannot exist in SimpleProperty description

While I am very new to the AI platform development, it appears to me that a { cannot exist in the description of a property. If I attempt to use

@SimpleProperty(category = PropertyCategory.APPEARANCE,
      description = "The URL of the custom tile layer to use as the base of the map. Valid URLs " +
          "should include {z}, \u007Bx\u007D and {{y}} placeholders and any authentication required.")

(Note, I am trying various options above)

then the resulting appinventor-sources\appinventor\appengine\build\war\WEB-INF\classes\com\google\appinventor\simple_components.json file contains:

            }, {
                "rw": "read-write",
                "deprecated": "false",
                "name": "CustomUrl",
                "description": "The URL of the custom tile layer to use as the base of the map. Valid URLs should include",    <<<<<<<<< truncated at {
                "type": "text",
                "category": "Appearance"
            }, {

This makes sense to me, if the intermediate format is JSON which uses curly brackets, however there should be a mechanism to include a literal { in the description. When I tried Unicode in the first position, it too truncated there. Escaping with a backslash also did not work.

Is there any working example (of a description that uses curly brackets) that I can use, please? I honestly do not feel like debugging appinventor-sources\appinventor\components\src\com\google\appinventor\components\scripts\ComponentDescriptorGenerator.java (I think this is the right place) to get it to work with {

Thank you

Peter

The problem occurs with only these 3 characters: ?@{ (question mark, at, open curly braces) in the ASCII range !..~ (dec 33..126)

The descriptions are typically pulled from the Javadocs, and so we treat the {@ characters as potential Javadoc content that isn't intended for our end users. You might be able to use HTML escape sequences to encode those characters, e.g., &#123; or &#64;, and see if that works.

Indeed, it does work:

image

Thank you very much!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.