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

Unable to run my same endpoint in different query and body value #665

Open
UnlimitedGa opened this issue Oct 8, 2024 · 3 comments
Open

Comments

@UnlimitedGa
Copy link

HI team i have one problem with my script same endpoint with different query and body values i can share my script logic here cloud you please given me you support to resolve this issue thanks

  - openApiOperationId: "PATCH::/v1/vehicle-types/{id}/add-entity"
    overwriteRequestPathVariables:
      - key: id
        value: "{{{vehicleTypeControllerGetVehicleTypeDetailsVRequestId}}}"
    overwriteRequestQueryParams:
      - key: entity
        value: ecu
    overwriteRequestBody:
      - key: "ecus"
        value: [{"ecuId": "{{ecuControllerCreateEcuRecordId}}", "regulations": [], "systemId": "{{vehicleSystemControllerCreateVehicleSystemId}}"}]
  
   - openApiOperationId: "PATCH::/v1/vehicle-types/{id}/add-entity"
    overwriteRequestPathVariables:
      - key: id
        value: "{{vehicleTypeControllerCreateVehicleTypeId}}"
    overwriteRequestQueryParams:
      - key: entity
        value: system
    overwriteRequestBody:
      - key: "systems"
        value: [{ "regulationId": "{{regulationControllerCreateRegulationId}}", "systemId": "{{vehicleSystemControllerCreateVehicleSystemId}}"}]

That patch method should call twice but only last operation performing first one not executed and can't see the logs

@UnlimitedGa UnlimitedGa changed the title Unable run my same endpoint in different query and body value Unable to run my same endpoint in different query and body value Oct 8, 2024
@thim81
Copy link
Collaborator

thim81 commented Oct 9, 2024

hi @UnlimitedGa

How do you make the request to the same endpoint?

@UnlimitedGa
Copy link
Author

Hi @thim81
My endpoint is Update my details in Two different array so my first request is

Patch :v1/vehicle-type/{id}/add-entity?entity=ecu
body json:{
ecus:["{ids}"]
}

Patch :v1/vehicle-type/{id}/add-entity?entity=system
body json:{
system:["{ids}"]
}

so these are update my data to database using same endpoint different body and query value
My service am using switch case to handle these operations

@thim81
Copy link
Collaborator

thim81 commented Oct 9, 2024

hi @UnlimitedGa

Postman typically runs 1 request, the request you see in your Postman collection.
How does your postman looks like?

If you want to modify the original request and later do another modified request, Portman provides the option to set "variations" https://github.com/apideck-libraries/portman/tree/main/examples/testsuite-variation-tests

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

No branches or pull requests

2 participants