-
Notifications
You must be signed in to change notification settings - Fork 2
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
Concept clarification wanted #104
Comments
Addendum: In case of slicing is not supported AND in case of the content of the square brackets is not encapsulated in single quotes, then the content of the square brackets has to be interpreted as index, referencing a list element (or a single string character). Therefore a value of type int is required. Burt something like Expected in this case are the usual Python error messages:
or
The current error message
is an indicator for a parsing problem of the JsonPreprocessor, who does not detect, that the colon is part of a dollar operator expression and must therefore not be interpreted as part of the JSON syntax. |
Hi Son, can you please check if slicing would be a problem. Thank you, |
@namsonx : What is the status of this issue? |
Hi @namsonx , |
Currently the JSON code
causes
It doesn't matter here that that slicing is not supported, but like I already mentioned in If square brackets do not contain a string (encapsulated in quotes) and do not contain a dollar operator expression, the content is assumed to be an index - and therefore has to be of type
|
Error message need to be improved as only a $-Expression, integer or string can be inside square-brackets. |
Hello Holger, I was not aware of the case of index like Thank you! |
Hi Holger, |
Retest causes following result:
Slicing applied to a string and to a list works (with hard coded integers). But because of the slicing feature is not supported, an error message is expected. The same with a dictionary:
Like expected, an error is thrown. But the error message is misleading. The expectation and proposal how to solve is already communicated in |
Hello Thomas, I will update the error message as Holger mentioned. Thank you, |
shifted to 0.11.0 |
Concept clarification done. Decision: Slicing has to be blocked (tracked in another issue). Observation: It's possible to apply indices to strings. Therefore we should handle this as an officially confirmed feature. This issue can be closed. |
integrated in RobotFramework AIO 0.11.0 |
I wanted to know what happens, when I apply an index to a string parameter:
And - it's so much cool - the JsonPreprocessor acts accordingly to the Python syntax rules: He returned the corresponding character:
This is really nice and we should mention this possibility in the documentation.
But when we mention this, it's obvious, that users will assume, that also slicing is possible.
I tried:
And I get the usual
Expecting ',' delimiter
error message, most probably because of the colon is interpreted as part of the JSON syntax, and not as part of the Python slicing syntax.
Here we need a more strict separation.
@thomas:
Please decide if the JsonPreprocessor shall support this feature.
If not, expressions like
"param2" : ${param1}[0:]
must cause a better error message.The text was updated successfully, but these errors were encountered: