Skip to content

Commit

Permalink
Igonre jax-rs @Context parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
altro3 committed Sep 4, 2024
1 parent a011b63 commit b62cfef
Showing 1 changed file with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ public static boolean isIgnoredParameter(TypedElement parameter) {
|| parameter.hasAnnotation("io.micronaut.session.annotation.SessionValue")
|| parameter.hasAnnotation("org.springframework.web.bind.annotation.SessionAttribute")
|| parameter.hasAnnotation("org.springframework.web.bind.annotation.SessionAttributes")
|| parameter.hasAnnotation("jakarta.ws.rs.core.Context")
|| isIgnoredParameterType(parameter.getType());
}

Expand All @@ -251,11 +252,26 @@ public static boolean isIgnoredParameterType(ClassElement parameterType) {
|| parameterType.isAssignable("kotlin.coroutines.Continuation")
|| parameterType.isAssignable(HttpRequest.class)
|| parameterType.isAssignable("io.micronaut.http.BasicAuth")

// servlet API
|| parameterType.isAssignable("jakarta.servlet.http.HttpServletRequest")
|| parameterType.isAssignable("jakarta.servlet.http.HttpServletResponse")
|| parameterType.isAssignable("jakarta.servlet.http.HttpSession")
|| parameterType.isAssignable("jakarta.servlet.http.PushBuilder")
|| parameterType.isAssignable("jakarta.servlet.ServletConfig")
|| parameterType.isAssignable("jakarta.servlet.ServletContext")
|| parameterType.isAssignable("jakarta.servlet.ServletRequest")
|| parameterType.isAssignable("jakarta.servlet.ServletResponse")

// jax-rs
|| parameterType.isAssignable("jakarta.ws.rs.core.Application")
|| parameterType.isAssignable("jakarta.ws.rs.core.HttpHeaders")
|| parameterType.isAssignable("jakarta.ws.rs.core.Request")
|| parameterType.isAssignable("jakarta.ws.rs.core.SecurityContext")
|| parameterType.isAssignable("jakarta.ws.rs.core.UriInfo")
|| parameterType.isAssignable("jakarta.ws.rs.core.Configuration")
|| parameterType.isAssignable("jakarta.ws.rs.container.ResourceContext")
|| parameterType.isAssignable("jakarta.ws.rs.ext.Providers")

// spring
|| parameterType.isAssignable("java.io.Reader")
|| parameterType.isAssignable("java.io.OutputStream")
Expand All @@ -267,7 +283,7 @@ public static boolean isIgnoredParameterType(ClassElement parameterType) {
|| parameterType.isAssignable("org.springframework.http.HttpMethod")
|| parameterType.isAssignable("org.springframework.validation.BindingResult")
|| parameterType.isAssignable("org.springframework.validation.Errors")
;
;
}

public static AnnotationMetadata getAnnotationMetadata(Element el) {
Expand Down

0 comments on commit b62cfef

Please sign in to comment.