Skip to content

RI-6959: Warn when overriding existing JSON key #291

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

Merged
merged 11 commits into from
Jun 24, 2025

Conversation

pawelangelow
Copy link
Collaborator

@pawelangelow pawelangelow commented Jun 13, 2025

This PR introduces a confirmation dialog that appears when a JSON update would overwrite an existing key. It uses the existing utility from the desktop repo to check if the target path already exists. If so, the user is prompted to confirm or cancel the overwrite before the change is applied.

To test it, consider a few cases:

root-level change

{
  "a": 1
  "a": 2 <--- try to add this
}

nested-level change

{
 "a": { 
     "b": 1 
  }
 "a": { 
     "b": 2 <--- try to add this
  }
}

nested-level change for array structure

{
 "a": { 
     "b": [
        1,
        2,
        3
     ] 
  }
 "a": { 
     "b": [
        1,
        2,
        3,
        4 <--- try to add this
     ] 
  }
}

array type structure

[
  1,
  2,
  "test",
  { "a": 1 },
  3 <--- try to add this
]

and you can experiment with the type of values - number, string, boolean, array, object, etc..

@pawelangelow pawelangelow self-assigned this Jun 13, 2025
@pawelangelow pawelangelow marked this pull request as ready for review June 16, 2025 13:51
@pawelangelow pawelangelow force-pushed the feature/verify-modified-paths-json branch from 95851df to b973b5b Compare June 16, 2025 14:57
@pawelangelow pawelangelow merged commit 99f2680 into main Jun 24, 2025
6 checks passed
@pawelangelow pawelangelow deleted the feature/verify-modified-paths-json branch June 24, 2025 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants