Uploaded image for project: 'Talend Component Kit'
  1. Talend Component Kit
  2. TCOMP-2591

Allow DiscoverSchema action to fill complex objects

Apply templateInsert Lucidchart Diagram
    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • 1.65.0
    • None
    • ui

    Description

      According documentation

      Mark a List<String> or List<Object> field as being represented as the component data selector.

      when using the following kind of code

       @Option
       @Documentation("Schema.")
       @Structure(type = Structure.Type.OUT, discoverSchema = GUESS_SCHEMA)
       private List<SchemaInfo> schema = Collections.emptyList();
      

      We expect, to fill an Object matching all or a set of properties matching the Schema.Entry interface...
      But, in fact in javascript code, it cannot handle anything but only the entry name (of Schema.Entry class):

      parent[key] = body.entries.map(entry => entry.name); 
      

      See code at https://github.com/Talend/ui/blob/0fc2e8ea8433070abacfd6eb0e61a577ed11ab95/packages/containers/src/ComponentForm/kit/defaultRegistry.js#L82

      This bug affects cloud environments.

      Here's the needed mappings:

      Structure field name Java type Name in studio Schema.Entry equivalent
      label String Column entry.name
      originalDbColumnName String Db Column entry.rawName
      key Boolean Key entry.props["field.key"]
      type String DB Type entry.type
      talendType String Type entry.props["talend.studio.type"]
      nullable Boolean Nullable entry.nullable
      pattern String Date Pattern entry.props["field.pattern"]
      length int Length entry.props["field.size"]
      precision int Precision entry.props["field.scale"]
      defaultValue String Default entry.defaultValue
      comment String Comment entry.comment

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              emmanuel_g emmanuel gallois
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: