Skip to content

Conversation

@ViPErCZ
Copy link
Contributor

@ViPErCZ ViPErCZ commented May 8, 2025

Hello...
when i send POST request with body

"items": [
    {
      "quantity": 0,
      "product": "/api/catalog/products/invalid-uuid"
    }
  ]

then i have error 500 response.
But GET method with wrong UUID identifier is Invalid uri variables with 404 status code.

This chage return better status e400 code.

@ViPErCZ ViPErCZ changed the title fix(error_status_code): InvalidUriVariableException status code (e400) fix(symfony,laravel): InvalidUriVariableException status code (e400) May 8, 2025
@soyuka
Copy link
Member

soyuka commented May 9, 2025

would it be possible to add a non-regression test?

@ViPErCZ
Copy link
Contributor Author

ViPErCZ commented May 9, 2025

Ok, I'll check it out and try.
I'll try to deliver within the week, if I have any problems, I'll write here in the thread. Thanks.

@ViPErCZ
Copy link
Contributor Author

ViPErCZ commented May 11, 2025

So, I added 3 tests. Hopefully it will be good. Thanks for any help. I have phpunit running locally. And the tests pass. If I return the original code, they will no longer pass. Thank you very much.

@soyuka soyuka force-pushed the feature/fix-InvalidUriVariableException-status-code branch from 574a2b8 to 445dd5e Compare May 12, 2025 08:18
@soyuka soyuka merged commit d3d0ca2 into api-platform:4.1 May 12, 2025
91 of 94 checks passed
@soyuka
Copy link
Member

soyuka commented May 12, 2025

Thanks @ViPErCZ

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

Successfully merging this pull request may close these issues.

3 participants