Hello,
I have a case where my endpoint is like /api/v1/users/{user_id}/address/{address_id}
- The system will try to create first a user doing a POST on
/api/v1/users. It gets an id id1
- Then it tries to do a POST to create an address (to test the PUT/DELETE) on
/api/v1/users/{user_id}/address
BUT in my case I also have an endpoint /api/v1/users/{user_id}/address for which I have some specific setup on a specific user with id my_id (which I created before), hence on that one I'm using path_relation to force /api/v1/users/my_id/address
The problem is that on step 2 when the system tries to create an address, it will do it on /api/v1/users/my_id/address (the user preconfigured above) and not on /api/v1/users/id1/address. That will create an address with id idA
And finally, when testing /api/v1/users/{user_id}/address/{address_id}, it will actually call /api/v1/users/id1/address/idA which will fail with 404 because address idA belongs to user my_id and not to user id1
I hope this is clear enough. I'll try to provide sanitized OAS when I have more time.
Note that this happens only since v2.0.0, on v1 I did not have the problem. This is blocking me from upgrading to v2.
I tried to circumvent that issue by using path_relation directly on /api/v1/users/{user_id}/address/{address_id} (on another predetermined user and address), but then the DELETE is called first, making the subsequent GET/PUT fail (since v1 we cannot force the path on a method anymore, it is on the whole endpoint)
Hello,
I have a case where my endpoint is like
/api/v1/users/{user_id}/address/{address_id}/api/v1/users. It gets an idid1/api/v1/users/{user_id}/addressBUT in my case I also have an endpoint
/api/v1/users/{user_id}/addressfor which I have some specific setup on a specific user with idmy_id(which I created before), hence on that one I'm usingpath_relationto force/api/v1/users/my_id/addressThe problem is that on step 2 when the system tries to create an address, it will do it on
/api/v1/users/my_id/address(the user preconfigured above) and not on/api/v1/users/id1/address. That will create an address with ididAAnd finally, when testing
/api/v1/users/{user_id}/address/{address_id}, it will actually call/api/v1/users/id1/address/idAwhich will fail with 404 because addressidAbelongs to usermy_idand not to userid1I hope this is clear enough. I'll try to provide sanitized OAS when I have more time.
Note that this happens only since v2.0.0, on v1 I did not have the problem. This is blocking me from upgrading to v2.
I tried to circumvent that issue by using path_relation directly on
/api/v1/users/{user_id}/address/{address_id}(on another predetermined user and address), but then the DELETE is called first, making the subsequent GET/PUT fail (since v1 we cannot force the path on a method anymore, it is on the whole endpoint)