spacewander commented on a change in pull request #948:
URL: https://github.com/apache/apisix-dashboard/pull/948#discussion_r533932864



##########
File path: web/src/pages/Route/transform.ts
##########
@@ -82,6 +82,7 @@ export const transformStepData = ({
       !Object.keys(step3DataCloned.script || {}).length ? 'script' : '',
       form1Data.hosts.filter(Boolean).length === 0 ? 'hosts' : '',
       form1Data.redirectOption === 'disabled' ? 'redirect' : '',
+      data.remote_addrs?.filter(Boolean).length === 0 ? 'remote_addrs' : '',

Review comment:
       > the frontend doesn't care about which array-like parameters should be 
omitted before sending requests
   
   Yes, but the backends care. This change just shift the duty to the backend.
   There are three problems:
   1. We have two backends. It is hard to sync the validation.
   2. jsonschema treat `empty array` and `omit array field` different. We have 
to write code manually twice.
   3. What if one day we want to distinguish `[]` from `nil`?




----------------------------------------------------------------
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.

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


Reply via email to