Need to add application/javascript and text/css as binary types for
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 30/100
- Tipo de issue
- Error
- Claridad
- Necesita aclaración
- Estado de actividad
- Estancado
- Stack tecnológico
- aws, java, spring-boot
Línea de trabajo
Comienza con el ejemplo enlazado de StreamLambdaHandler.java e inspecciona la configuración del contenido binario del contenedor serverless para las respuestas de AWS. Reproduce el problema con springdoc-openapi-starter-webmvc-ui y determina después si application/javascript y text/css deberían reconocerse de forma predeterminada; se considera completado cuando los recursos de Swagger UI se cargan a través de API Gateway y existe cobertura para el comportamiento de respuesta esperado.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
I don't know which component in the stack is wrong.
- springdoc-openapi-starter-webmvc-ui will serve up swagger-ui/index.html, locally 100% and when deployed to a AWS API Gateway (HTTP-style) only some .js files and the .html file serve, the rest blowing up in the API Gateway response with no error message
I think the minimal repro is to add springdoc-openapi-starter-webmvc-ui (via pom.xml) to the ping controller example (which is a bad name for an endpoint because it clashes with the automatically provided route of AWS API Gateway, I usually have to rename it to pong)
I told the container to treat application/javascript and text/css as binary and API Gateway stopped trying to do something (unnecessary encoding/decoding) to the response and now swagger-ui loads.
I'm leaving this here because other issues have run into the same problem and came up with worse workarounds (like stop even trying to serve some content types on API Gateway at all)
That this works locally in tomcat makes me think that something is wrong with API Gateway or serverless-container.
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.8.6</version>
</dependency>
public class StreamLambdaHandler implements RequestStreamHandler, Resource {
private static SpringBootLambdaContainerHandler<AwsProxyRequest, AwsProxyResponse> handler;
static {
try {
handler = SpringBootLambdaContainerHandler.getAwsProxyHandler(Application.class);
LambdaContainerHandler.getContainerConfig().addBinaryContentTypes("application/javascript");
LambdaContainerHandler.getContainerConfig().addBinaryContentTypes("text/css");
} catch (ContainerInitializationException e) {
// if we fail here. We re-throw the exception to force another cold start
e.printStackTrace();
throw new RuntimeException("Could not initialize Spring Boot application", e);
}
}
}
- Lenguaje dominante
- Java
- Estrellas
- 1.6k
- Forks
- 575
- Merge medio
- 1 d 15 h
- PR fusionados (30 d)
- 12
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de aws/serverless-java-container
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
aws/serverless-java-container#1729 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
aws/serverless-java-container#1715 ·
Los mantenedores suelen responder en 1 día
-
Support for API Gateway mTLS clientCert fieldPosiblemente ocupada @2748109647 la tomó hace 10 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 48/100
aws/serverless-java-container#1726 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
aws/serverless-java-container#1579 · 3 comentarios · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 42/100
aws/serverless-java-container#1568 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de aws/serverless-java-container
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
ls1intum/thesis-management#1473 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
LunaDeerMC/Dominion#301 · 1 comentario ·
-
[FEATURE] Expose external refresh, node-level translog and warmer statsPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertountriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
opensearch-project/opensearch-prometheus-exporter#680 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100