New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Array copy item with UUID: first copy has a duplicated UUID #1481
Comments
Hi @simontaurus, When adding uuid items with the "+ Item" button everything works like expected. Because the uuid editor create their own value at creation in order to be universally unique. When copying items the Array editor will check if it#s item is I guess the issue it's about setting the array value directly in which 2 items are identical. If that is so the value should be stripped off from duplicated items before setting the value of the array. Additionally the constrain "uniqueItems" can be added to the array schema to show validation errors. I'm closing this because i think that was the issue, which is not a json editor bug, but feel free to reopen it if i missed something :) |
@germanbisurgi: I don't have permissions to reopen the issue, but it would be great to have some further discussion:
Makes sense, so the copied item is a true and full copy, including the uuid. But actually the uuid seems to be regenerated first and then copied so it's not possible to keep the uuid of the first element and also not achievable to create more than two array items with the same uuid: First array element get's a uuid: One could also argue that a UUID is per definition global unique and should never be duplicated. However, with a fixed |
General information
Expected behavior
Each array element should have a unique ID
Actual behavior
The first copy has the same UUID as the first element
Seems like #1129 is only partially solved in the current release
Steps to reproduce the behavior
Direct link to example: playground
Creating a first element a two copies leads to
A workaround is to use a uuid template instead: #1485
The text was updated successfully, but these errors were encountered: