SinhSinhAn opened a new pull request, #3377:
URL: https://github.com/apache/apisix-dashboard/pull/3377
## Summary
- Fix `discovery_args` Zod schema to preserve user-entered JSON properties
The `UpstreamDiscovery` schema used `z.object({})` for `discovery_args`,
which causes Zod to strip all unknown properties during parsing. Any
user-entered JSON (e.g., `{"group_name": "my-group"}`) was silently reduced to
`{}` before reaching the APISIX Admin API.
Replaced with `z.record(z.string(), z.unknown())` to allow arbitrary
key-value pairs, consistent with how `Plugin` is typed in `plugins.ts`.
## Test plan
- [ ] Open Upstream create/edit form
- [ ] Select a Discovery Type and enter Discovery Args JSON (e.g.,
`{"group_name": "my-group"}`)
- [ ] Save the upstream
- [ ] Verify the `discovery_args` value persists correctly on the detail page
- [ ] Verify existing upstreams without `discovery_args` still work
Fixes #3376
--
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]