-
Notifications
You must be signed in to change notification settings - Fork 279
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
Can't Dredd set URI parameters default value? #709
Comments
@motoyasu-saburi I'll take a deeper look later, but at first sight, I'd say there might be a problem with using 2 spaces for indentation of the |
Moreover, it looks like you even use mixed indentation:
(by two, then by two + four) |
@honzajavorek Thank you quickly answer! 4 spaces pattern.
result
Dredd set mistake URI parameter |
I went to Apiary and tried to render documentation from your API Blueprint. It looks like the markup is definitely correct, because the documentation renders correctly: When I try to run the latest Dredd, I was able to reproduce your problems: $ dredd apiary.apib http://example.com
info: Beginning Dredd testing...
fail: GET /api/applications?offset=0&limit=20&sortOrder=DESC&text=20&unreadOnly=false duration: 314ms
info: Displaying failed tests...
fail: GET /api/applications?offset=0&limit=20&sortOrder=DESC&text=20&unreadOnly=false duration: 314ms
... This is a bug in Dredd, or more precisely, in Dredd Transactions. Thanks for reporting this! If you want to work on a fix, I'd expect compileParameters() to be the culprit. If you don't feel like contributing a solution, you could at least send a failing test. What do you think? |
I suspect there would be a variable in a loop iterating over parameters, which doesn't get cleared out between iterations, thus |
I thought this cause is here 🤔
If initialization is not done, I think that the previous |
@motoyasu-saburi I think that's it! Would you send a PR to fix this? I'd be happy to provide help on how to approach this and how to write a test. |
I try set default value for URI parameters at this issue comment.
#541 (comment)
but, Dredd display "warning" or set mistake default value at URI parameter.
node ver : v6.9.1
dredd ver: v2.2.5
dredd --version
output: 3.10.8pattern 1
Result pattern 1 :
non errors and warnings.
but, Dredd set mistake value 'text=20' for URI Parameter.
pattern 2
correct value.
but, display warn.
The text was updated successfully, but these errors were encountered: