test-fullautomation / python-jsonpreprocessor

A preprocessor for json files
Apache License 2.0
2 stars 2 forks source link

Naming convention violation (3) #355

Open HolQue opened 3 hours ago

HolQue commented 3 hours ago

How to handle leading and trailing blanks inside key names?

JSON:

" param " : "value"

Result:

DotDict({' param ': 'value'})

I have doubts that it makes sense to allow this.

But if leading blanks are part of a key name, than this is a naming convention violation. Because the naming convention tells: Key names have to start with a letter, digit or underscore. And a blank is nothing of them.

Cross check (forbidden character added):

" #param " : "value"

Result:

Invalid key name: " #param ". Key names have to start with a letter, digit or underscore.

Conclusion: The leading blanks are part of the key name, but not involved in the naming convention check. In my opinion this is inconsistent.

HolQue commented 3 hours ago

How about blanks inside a key name?

This is accepted:

"par am" : "value"

Shall this be allowed or not?