package io.quarkus.rest.runtime.injection;

import javax.enterprise.context.RequestScoped;
import javax.enterprise.inject.Produces;
import javax.inject.Inject;
import javax.inject.Singleton;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.UriInfo;
import javax.ws.rs.sse.Sse;

import io.quarkus.rest.runtime.core.QuarkusRestRequestContext;
import io.quarkus.rest.runtime.jaxrs.QuarkusRestSse;
import io.quarkus.vertx.http.runtime.CurrentVertxRequest;

@Singleton
public class ContextProducers {

    @Inject
    CurrentVertxRequest currentVertxRequest;

    @RequestScoped
    @Produces
    UriInfo uriInfo() {
        return getContext().getUriInfo();
    }

    @RequestScoped
    @Produces
    HttpHeaders headers() {
        return getContext().getHttpHeaders();
    }

    @Singleton
    @Produces
    Sse sse() {
        return QuarkusRestSse.INSTANCE;
    }

    private QuarkusRestRequestContext getContext() {
        return (QuarkusRestRequestContext) currentVertxRequest.getOtherHttpContextObject();
    }
}

@@ -457,16 +457,283 @@
 equest;%0A
+import io.vertx.core.http.HttpServerRequest;%0A%0A/**%0A * Provides CDI producers for objects that can be injected via @Context%0A * In quarkus-rest this works because @Context is considered an alias for @Inject%0A * through the use of %7B@code AutoInjectAnnotationBuildItem%7D%0A */
 %0A@Single
@@ -1135,24 +1135,337 @@
 NCE;%0A    %7D%0A%0A
+    // HttpServerRequest is a Vert.x type so it's not necessary to have it injectable via @Context,%0A    // however we do use it in the Quickstarts so let's make it work%0A%0A    @RequestScoped%0A    @Produces%0A    HttpServerRequest httpServerRequest() %7B%0A        return currentVertxRequest.getCurrent().request();%0A    %7D%0A%0A
     private 

Add support for doing injecting HttpServerRequest with @Context