contributte / api-router

:man: RESTful router for your API in Nette Framework (@nette). Created either directly or via annotation.

Home Page:https://contributte.org/packages/contributte/api-router.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BC break introduced in 4.2

survik1 opened this issue · comments

Hello, we are dealing with BC break from 4.2 that we cant get around. Let me try to describe our app.

We have rather huge monorepo with application that has several different APIs among other stuff. Their EPs are located at /api1/index.php, /api2/index.php and so on. And with that we have a single RouterFactory service. This service maps requests like /api1/v1/probe or /api2/v1/probe. As 4.2 dropped basepath, the library forces us to rewrite the mapping to /v1/probe which leads to conflict. And there is no option to supress this new behavior.

I'd kindly like to ask to revert this change or to intorduce something to turn it off. Otherwise we will have to abandon this library.

Hi @survik1. There should be way how to add /api1 to your api routes.

Can you please create a MVP at https://github.com/contributte/api-router-skeleton? I mean /api1/index.php etc.

@f3l1x Hello, sorry for delay. The code is available at https://github.com/survik1/api-router-skeleton/tree/issue-52-proof-of-the-bc-break

Using 4.1 you should be able to access /api1/ping with response pong A and /api2/ping with response pong B, using 4.2 and higher the router will break.

Thanks for reproduction. I've implemented option to enable/disable basePath detection. Feel free to disable basePath in your app.