Not bug exactly. Or are you seeing some unexpected behavior?
The prefix is applied defined when including my.routes and not by the sub-router itself. If you open the main generated router, you will see the prefix being applied at the include declaration (search for something like Include(myRoutes.withPrefix(...)).
I’m encountering the same issue (Play 2.8.2). When using split routes sometimes (very seldom) the prefix is not picked up when running tests. Are the prefixes somehow lazy:ly injected after the test has already begun?
Did you @KoenDG resolve the issue or find a work-around? I guess hard coding the api endpoints as strings would work, but that’s kind of annoying when the route path should be available from the reverse routes.
Haven’t worked with Play since changing jobs in 2018.
I recall I never ended up using this in production and the solution I came up with required the manual creation of a subdirectory with a specific name, per part of the url that was being split off.
Which was really cumbersome after a while and thus it ended up not happening.
There should be some kind of analysis that can be done in the compiled java files, in some target folder somewhere. It should have details somewhere of what it expects the path to be.
But that’s a real deep rabbithole you’re going down, if you choose to do so.
The behaviour of the router did change in 2.8.2 so the router gets lazily injected, and this may be why the prefix is missing when you run tests. Quite a frustrating issue to debug: