Skip to content
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

Fuzzing - Variation Requests for a range of request examples #191

Open
thim81 opened this issue Dec 3, 2021 · 4 comments
Open

Fuzzing - Variation Requests for a range of request examples #191

thim81 opened this issue Dec 3, 2021 · 4 comments
Assignees
Labels
new feature New potential functionality

Comments

@thim81
Copy link
Collaborator

thim81 commented Dec 3, 2021

Currently Portman generates a variation where the 1 example is used as request body in the generated request.

In case there are multiple examples, Portman could generate a variation per example:

  /mobile/v1/messages/push/send:
    post:
      operationId: post-push-send
      x-include: true
      x-release: live
      summary: Send push messages
      description: Send push messages in bulk to a range of devices.
      parameters:
        - $ref: '#/components/parameters/X-OAuth2'
        - $ref: '#/components/parameters/application-json'
      requestBody:
        content:
          application/json:
            schema:
              description: The payload for sending a push messages in bulk.
              type: array
              items:
                $ref: '#/components/schemas/SendPushBulkModel'
            examples:
              sample-send-push-apple:
                $ref: '#/components/examples/sample-send-push-apple'
              sample-send-push-google:
                $ref: '#/components/examples/sample-send-push-google'
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendPushBulkResponse'
      tags:
        - Bulk sending
@thim81 thim81 added the new feature New potential functionality label Dec 3, 2021
@BenjaminDC
Copy link

@thim81 that would be a great for customers who use generated postman collection from the spec 🙏

@thim81
Copy link
Collaborator Author

thim81 commented Oct 11, 2022

hi @BenjaminDC

I'm curious about what you interpret this feature and what would you expect as a result?
Would you mind sharing your use-case/experience.

@BenjaminDC
Copy link

Basically, what I expect is the ability to specify an example reference in the variation Tests and then having one postman request per variation.
if the example reference is not specified, then we could fallback to the first one.

proposal :

{
      "openApiOperationIds": [
        "post-push-send"
      ],
      "exampleReference": "#/components/examples/sample-send-push-google", <---
      "overwriteRequestBody": [
        {
          "key": "[0].content.expiration",
          "value": "{{expiration_date_future}}",
          "overwrite": true
        },
        {
          "key": "[0].context.profile",
          "value": "automation_profile",
          "overwrite": true
        },
        {
          "key": "[0].reference",
          "value": "newman{{$guid}}",
          "overwrite": true
        }
      ]
    }

@thim81
Copy link
Collaborator Author

thim81 commented Oct 18, 2022

@BenjaminDC This is a good proposal, we might tweak it a bit with regards to the setting name.

We are working on adding some support for overwriting "form-data" & "x-www-form-urlencoded" request bodies.
We will try to find some time after that to work on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New potential functionality
Projects
None yet
Development

No branches or pull requests

2 participants