Commit a1d8373
committed
insight playground - allow array items to be single item (#7373)
Fixes validation for query params that can be single or multiple value.
E.g. `?contract_address=0x...&contract_address=0x..` and `?contract_address=0x..` are both valid queries. Doing just 1 value as in the second variant did not pass validation previously, but now does
<!-- start pr-codex -->
---
## PR-Codex overview
This PR modifies the schema validation logic in the `blueprint-playground.client.tsx` file to handle required and optional array or single item schemas more effectively.
### Detailed summary
- Updated the return value to use `arrayOrSingleItemSchema` for both required and optional cases.
- Introduced `arraySchema` to define the structure of required arrays.
- Created `arrayOrSingleItemSchema` to combine array and single item schemas.
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- **New Features**
- Enhanced form input flexibility to accept either a single item or an array of items for array-typed parameters.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent 3dbf9e1 commit a1d8373
File tree
1 file changed
+6
-2
lines changed- apps/playground-web/src/app/insight/[blueprint_slug]
1 file changed
+6
-2
lines changedLines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
815 | 815 | | |
816 | 816 | | |
817 | 817 | | |
818 | | - | |
| 818 | + | |
819 | 819 | | |
820 | | - | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
821 | 825 | | |
822 | 826 | | |
823 | 827 | | |
| |||
0 commit comments