-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Multiple requests and responses with same status code and different parameters #132
Comments
@netmilk I would say
Assuming implicit request pairs, I am not sure why you need it for response (as that is associated with the request), how this would be different to #58 (comment) |
+1 Looking forward to use this feature |
+1 We need this too |
+1 great |
@netmilk Frankly, I think this could all go a step further in the blueprint by putting an absolute (non-tempated) URI on a request element and being able to access the associated response by calling that URI. Further, it would be nice to tag those responses and be able to access them by tag in say the machine column with a selector. This idea overlaps with another issue I have noted this possibility on that @zdne could cross-reference here if appropriate. |
@fosrias would you mind sketching a pseudo example of your proposal (of using an URI instance). Re tags – I would try to not tie this one to another feature unless it does not make sense without it. |
+1 Would love to see this implemented! With a basic resource collection that supports pagination, searching, sorting and filtering on 'published':
There is no way to have different examples for only search, or only sort, or only filter. Currently the parameters are scoped to an action (e.g. [GET]), but they should be scoped to a request (or an example of they encapsulate a request+response pair). The current workaround is to create 4 different resource collections, each have their own [GET] and unique parameters, just to have them show up as different testable actions. |
Hey @ThaNarie thanks for feedback! This is definitely a planned feature – #58 – we should be able to define transaction examples based on parameters' value. Note the |
Hey @zdne, Thanks, looking forward to it! I did indeed notice the shorter variant, although they seem to work both I did already changed it to the shorter version :) |
You are right – the longer version is technically correct as well. |
+1 |
+1 |
1 similar comment
+1 |
Closing this one as duplicate to #58 .
You can already name requests, please let me know if it is not sufficient.
You can already have multiple responses with same status codes, let me know if this is not sufficient.
I like it. Should we move this feature request to #58 ? |
@zdne Yes. Feel free to move it there. |
now can we use this ? if yes how ? |
☝️ |
Is this feature merged to master? |
At this moment API blueprint does not support multiple examples (request and response pairs) for invoking different behavior on same action with same status code for testing and specifying non optimistic or corner API behavior. For full support of this feature in blueprint we need at least one of following blueprint extensions:
Example:
As a workaround in Dredd, I propose to allow user be able to programatically create new named transaction example under same resource action in the AST. Action will be flagged in the AST and it will be highlighted in Dredd results to distinguish between actions is coming from AST and manually created.
Or user will can be allowed to load data stored in another blueprint:
The text was updated successfully, but these errors were encountered: