SimplixStorage icon indicating copy to clipboard operation
SimplixStorage copied to clipboard

Dot in key create problem with FlatFile

Open uiytt opened this issue 2 years ago • 1 comments

Describe the bug When there is a dot (.) in the key of a valid json (or any other) file like this :

{
	"test" : {
		"test2.test3": "Should work"
	}
} 

FlatFile#get("test.test2.test3") doesn't return anything.

But

{
	"test" : {
		"test2": {
			"test3" : "It works "
		}
	}
} 

Correctly return "It works"

Expected behavior When the key of a file contains a dot, it should still work.

Desktop (please complete the following information):

  • SimplixStorage: 3.2.6

uiytt avatar Sep 07 '23 13:09 uiytt

I have one question regarding this issue. If you have this json object:

{
	"test" : {
		"test2.test3": "Should work",
	        "test2": {
		        "test3" : "It works "
	        }
	}
} 

What should this call FlatFile#get("test.test2.test3") return? It would not be deterministic, since both would match. I think a better idea would be that FlatFile#get("test.test2.test3") return the latter and FlatFile#get("test.test2\.test3") returns the former. This would make more sense to me.

yoyosource avatar Feb 29 '24 07:02 yoyosource