-
-
Notifications
You must be signed in to change notification settings - Fork 193
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
Value mismatch error when values seem to be the 'same' #20
Comments
I'm guessing this is because it's an integer and user_id is being implicitly converted to an int at some point. Because it might be desirable to actually have the distinction between an integer and a string being returned I'm not sure what the best thing to do is to fix this - it should at least print something more useful like
|
@michaelboulton This has been released right? |
Currently, values from variables can only be passed by using string formatting ( We should come up with another way of passing variables as they are. This might also be useful for passing whole json-blocks as data. String-formatting should stay as it has its own use case (e.g. Maybe a special token might be appropriate here. I am not sure which tokens are reserved in the yaml spec, so the symbol might need to be changed. user_id: $user_id |
This can be done using the yaml 'tags' (specs here http://www.yaml.org/spec/1.2/spec.html#id2803311) - for example: request:
json:
user_id: !!int "{user_id_as_int:d}" and custom tags can also be added (this is used for It should be possible to make this 'pluggable' in future because it is just registering a function (eg Lines 29 to 30 in 3f395e0
|
Using the default yaml tags does not work, unfortunately, because they are constructed before any string formatting is done. I propose a solution involving an intermediate token which gets converted after string formatting is done. See #50 for my approach. |
Command
Response in Terminal
Test to save
user_id
from responseTest to use
user_id
in subsequent testThe text was updated successfully, but these errors were encountered: