-
I have a method bean that automatically fetches data for a path parameter. For example: @Path("v0/server/{server}/something")
public class ApiClass {
@Inject
ServerInfo server;
... methods
} BeanProducer: @Produces
@DefaultBean
@RequestScoped
public ServerInfo server(RoutingContext context) {
var name = context.pathParam("server");
... logic
} However, when I try to test it, the pathParam method returns null. The standard |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 16 replies
-
I'm not sure if this ist the root of the problem, but ApiClass must also have the annotation @RequestScoped. |
Beta Was this translation helpful? Give feedback.
-
@kyngs Have you found a solution for this? I need to accomplish the same thing. |
Beta Was this translation helpful? Give feedback.
-
I think that you're mixing two APIs - JAX-RS ( |
Beta Was this translation helpful? Give feedback.
I haven't tried it, but:
should allow you to inject
List<PathSegment>
into any CDI bean.I'll warn you though that is not really a supported use case, so if someone comes to me in the future saying it doesn't work, I can't say I'll go out of my way to fix it :)