Skip to content
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

Naming convention violation (3) #355

Open
HolQue opened this issue Oct 24, 2024 · 3 comments
Open

Naming convention violation (3) #355

HolQue opened this issue Oct 24, 2024 · 3 comments
Assignees
Labels

Comments

@HolQue
Copy link
Collaborator

HolQue commented Oct 24, 2024

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
Copy link
Collaborator Author

HolQue commented Oct 24, 2024

How about blanks inside a key name?

This is accepted:

"par am" : "value"

Shall this be allowed or not?

@namsonx namsonx self-assigned this Dec 25, 2024
@namsonx
Copy link
Collaborator

namsonx commented Dec 25, 2024

Hello Holger,

The fix for the first case " param " : "value" was pushed to stabi branch.

For the second case "par am" : "value", we should discuss with Thomas before making a decision.

Thank you,
Son

@HolQue
Copy link
Collaborator Author

HolQue commented Jan 2, 2025

Hi Son,

The error message of

"  param  " : 1,
"p21"       : ${param}

changed from

'The parameter '${param}' is not available!'

to

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

Hmm, both is not nice. My current understanding of the naming convention I have posted here:

#356 (comment)

And I added this content also to the component description. I assume now that this is valid.

The last point of the naming convention is:

But leading and trailing blanks will be removed (and therefore do not cause errors).

Therefore my expectation of the JSONP content above is:

"p21" = 1

As per

#356 (comment)

blanks inside key names are not allowed. Also the naming convention tells that only letters, digits and some assorted special characters are allowed. Blanks are not part of this list of allowed special characters. Therefore this

"par am" : "value"

should not be allowed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants