Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-9441

Support script execution returning JSON objects

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Unresolved
    • Major
    • None
    • None
    • None
    • None

    Description

      When the last expression in a script returns a JSON object, this is returned as String [object Object]. E.g.

      var obj = { k: 1, v: 2}
      obj
      

      This is because ScriptingEngine's eval method returns an instance of javax.script.Bindings (as ScriptObjectMirror) which is a Map<String, Object>.

      Our integration layer should detect the type of the returned object and adjust it for the consumer.

      A simple workaround is to wrap the final object around JSON.stringify call, e.g.

      var obj = { k: 1, v: 2}
      JSON.stringify(obj)
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            rh-ee-galder Galder ZamarreƱo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: