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

Request with pathParam returning 400 code #2439

Closed
2 tasks done
Ukrainis opened this issue Jun 11, 2024 · 9 comments · Fixed by #2465
Closed
2 tasks done

Request with pathParam returning 400 code #2439

Ukrainis opened this issue Jun 11, 2024 · 9 comments · Fixed by #2465
Assignees
Labels
bug Something isn't working

Comments

@Ukrainis
Copy link

I have checked the following:

  • I use the newest version of bruno.
  • I've searched existing issues and found nothing related to my issue.

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

@Ukrainis Ukrainis added the bug Something isn't working label Jun 11, 2024
@hochwalp
Copy link

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

@fgrande
Copy link
Contributor

fgrande commented Jun 11, 2024

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
Copy link
Contributor

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.

@sanjai0py sanjai0py self-assigned this Jun 12, 2024
@Ukrainis
Copy link
Author

Ukrainis commented Jun 12, 2024

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
Copy link
Collaborator

sanjai0py commented Jun 12, 2024

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

@Ukrainis
Copy link
Author

Ukrainis commented Jun 12, 2024

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

Attached collection:
Personal.json

@fgrande
Copy link
Contributor

fgrande commented Jun 12, 2024

@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.

@sanjai0py sanjai0py mentioned this issue Jun 17, 2024
5 tasks
@helloanoop
Copy link
Contributor

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
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants