SbloodyS commented on PR #18434:
URL:
https://github.com/apache/dolphinscheduler/pull/18434#issuecomment-5087850800
The UI and worker validation are still inconsistent for the `"{}"`
placeholder.
`DataxParameters.checkParameters()` treats `"{}"` as an absent inline
definition and rejects it when no resource is attached. However, the UI
validator only checks whether `model.json` is blank and whether it is valid
JSON. Therefore, `"{}"` passes the UI validation without a resource, but the
task is later rejected during worker initialization.
The exact string comparison also does not recognize semantically equivalent
empty objects such as `{ }` or a formatted multi-line empty object. When a
resource is attached, these values will be treated as inline JSON and the
resource fallback will not be used.
Please determine whether the inline JSON is an empty object semantically
instead of comparing it with the literal `"{}"`, and apply the same rule
consistently in both UI and backend validation. Please also centralize the
backend check instead of duplicating it in `DataxParameters` and `DataxTask`,
and add coverage for `"{}"`, `{ }`, and a formatted empty object, both with and
without a resource.
--
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]