a top-level array as initialValue is corrupted
Author: fembauCreated Mar 19, 2026Updated Mar 19, 2026
What happened?
I want to use a schema with an array as top-level structure.
Works in v4 but, in v5 the initial value (=array) is somehow converted to an object with index as keys.
actual value:
{
"0": {
"field1": "field1",
"field2": "field2"
}
}expected value:
[
{
"field1": "field1",
"field2": "field2"
}
]I figured out that I can use "." as name for the top-level array. If this is the proper way to do it please add this in the documentation. Didn't found it here.
<FieldArray name="." #default="{ fields }">Reproduction steps
- use an initial value with an array as top-level structure
Version
Vue.js 3.x and vee-validate 5.x
What browsers are you seeing the problem on?
- Firefox
- Chrome
- Safari
- Microsoft Edge
Relevant log output
Demo link
https://stackblitz.com/edit/vee-validate-issue-template-pzg7lfwl?file=src%2FApp.vue
Code of Conduct
- I agree to follow this project's Code of Conduct
Source: logaretm/vee-validate