yzeng1618 commented on issue #10579:
URL: https://github.com/apache/seatunnel/issues/10579#issuecomment-4022250241

   ```mermaid
   flowchart LR
     A[Web / REST Client] --> B[GET /option-rules]
     B --> C[OptionRulesServlet]
     C --> D[OptionRulesService]
     D --> E[PluginDiscovery]
     E --> F[Plugin Factory]
     F --> G[OptionRule]
     D --> H[DTO Converter]
     H --> I[JSON Response]
   
   ```
   A possible implementation is to add a read-only Zeta API that returns the 
full runtime `OptionRule` instead of a flattened required/optional list.
   
   Example response:
   
   ```json
   {
     "engineType": "seatunnel",
     "pluginType": "source",
     "pluginName": "FakeSource",
     "optionRule": {
       "optionalOptions": [
         {
           "key": "row.num",
           "type": "java.lang.Integer",
           "defaultValue": 1000,
           "description": "fake source row num",
           "fallbackKeys": [],
           "optionValues": null
         }
       ],
       "requiredOptions": [
         {
           "ruleType": "ABSOLUTELY_REQUIRED",
           "options": [ ... ]
         },
         {
           "ruleType": "EXCLUSIVE",
           "options": [ ... ]
         },
         {
           "ruleType": "BUNDLED",
           "options": [ ... ]
         },
         {
           "ruleType": "CONDITIONAL",
           "options": [ ... ],
           "expression": "schema.fields == true AND schema.names != null",
           "expressionTree": { ... }
         }
       ]
     }
   }
   ```
   
   This way we preserve the full semantics of `OptionRule`, including 
`ABSOLUTELY_REQUIRED`, `EXCLUSIVE`, `BUNDLED`, and `CONDITIONAL`.  
   For conditional rules, returning both `expression` and `expressionTree` 
would make it easier for SeaTunnel Web to build dynamic forms based on the 
actual connector version installed on the server.
   
   Does this solution meet the requirements? @gitfortian 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to