usebruno / bruno

Opensource IDE For Exploring and Testing Api's (lightweight alternative to postman/insomnia)
https://www.usebruno.com/
MIT License
21.54k stars 1.01k forks source link

Request with pathParam returning 400 code #2439

Closed Ukrainis closed 1 week ago

Ukrainis commented 2 weeks ago

I have checked the following:

Describe the bug

When using :pathParam in request, then getting response code 400. Same with hardcoded parameter giving correct response. In attachment you will find two same requests, one with pathParam (returns 400), second without (returns 200 and correct data). And two screenshots of same requests.

.bru file to reproduce the bug

Not working: meta { name: Get user with pathParam type: http seq: 2 }

get { url: https://spring-boot-test-aplication.herokuapp.com/api/users/findById/:id body: none auth: none }

params:path { id: 16 } Same but without pathParam and working: meta { name: Get user without pathParam type: http seq: 3 }

get { url: https://spring-boot-test-aplication.herokuapp.com/api/users/findById/16 body: none auth: none }

Screenshots/Live demo link

Using_pathParam Without_pathParam

hochwalp commented 2 weeks ago

We have this issue as well, it seems to only occur when the pathParam is the last element of the url.

fgrande commented 2 weeks ago

On my Mac, Bruno 1.19.0 works fine, with a path param at the end of a url. Not able to reproduce what @Ukrainis says, in both cases (with/without param) the application returns 404 (due to application not found)

layereight commented 2 weeks ago

We have this issue as well, it seems to only occur when the pathParam is the last element of the url.

Same here. We're always getting HTTP 400 as response.

Ukrainis commented 2 weeks ago

On my Mac, Bruno 1.19.0 works fine, with a path param at the end of a url. Not able to reproduce what @Ukrainis says, in both cases (with/without param) the application returns 404 (due to application not found)

This is working endpoint, just checked, gave same results, as described in a bug.

We have this issue as well, it seems to only occur when the pathParam is the last element of the url.

Getting same, when this is not at end of the url, like {baseUrl}/:id/status.

sanjai0py commented 2 weeks ago

Could you share more information by sharing a .bru file or a JSON export?

Ukrainis commented 2 weeks ago

Could you share more information by sharing a .bru file or a JSON export?

Attached collection: Personal.json

fgrande commented 2 weeks ago

@sanjai0py I made some test locally, and my fix would work.

I suppose that the problem is wider, "params" property is the same as axios, and - I suppose - they are in conflict. But since we already translate variables, we can simply empty it.

helloanoop commented 1 week ago

PR has been merged. Thanks for working on this @fgrande @sanjai0py !

This is set to be released in the upcoming v1.20.0 release.

dave-stone-bah commented 21 hours ago

PR has been merged. Thanks for working on this @fgrande @sanjai0py !

This is set to be released in the upcoming v1.20.0 release.

@helloanoop Any info on when that release might happen? Thanks!