-
Notifications
You must be signed in to change notification settings - Fork 280
Testing resources with optional parameters #88
Comments
Thank you for interesting use case, but t this moment there is no way how to prevent parameter substitution. When parameter is defined, example value is always used in the request, even if parameter is optional. |
Just a little update: More straightforward syntax for this is discussed also in API Blueprint project: apiaryio/api-blueprint#132 apiaryio/api-blueprint#58 (comment) |
This is blocked by support for Parameters under each Request secction in the API blueprint apiaryio/api-blueprint#58 At this moment, as a workaround, you can change the request URI in the |
👍 |
1 similar comment
+1 |
+1. 4 years since this and it's a pretty basic functionality IMHO... |
The implementation in the API Blueprint format still isn't in general availability. Please express your feelings under the linked issue. Dredd isn't in a position it could easily overcome the problem, as it is a limitation of the format. Also, note there are workarounds in the comments above. |
@pakore I'm sorry, I did not notice the issue is locked. My apologies. It is the first thing on the public roadmap though. |
Even though it's not an officially rolled-out feature in API Blueprint and Apiary, the parser supports request parameters for a long time already and Dredd does as well. Please open other issues if you find the behavior buggy. Closing this in favor of #1118. |
Upgrade minim, fury.js, and fury adapters
How do I test optional parameters?
----Sample URL----
Resources/CarSharing/All?lat={lat}&lng={lng}&radius={radius}
----Parameters description----
52.52
) ... Stringlat
latitude value. Has example value.13.39
) ... Stringlng
longitude value. Has example value.1000
) ... Stringradius
longitude value. Has example value.I would like to check at least 2 cases: 1) a call with parameters and their sample values and 2) a call without any parameters:
Thank you!
The text was updated successfully, but these errors were encountered: