I am trying to deploy a spring boot , Java, Swagger application, everything is working fine except the swagger UI.
I am getting this below error.
File path not allowed: /swagger-ui.html
at com.amazonaws.serverless.proxy.internal.SecurityUtils.getValidFilePath
(SecurityUtils.java:192) ~[task/:na]
You can use the aws-serverless-java-container library to run a Spring Boot application in AWS Lambda. You can use the library within your Lambda handler to load your Spring Boot application and proxy events to it. In the repository we have included a sample Spring Boot application to get you started.
To enable the Swagger2 in Spring Boot application, you need to add the following dependencies in our build configurations file. For Gradle users, add the following dependencies in your build. gradle file. Now, add the @EnableSwagger2 annotation in your main Spring Boot application.
This is an old bug in Amazon's library.
<dependency>
<groupId>com.amazonaws.serverless</groupId>
<artifactId>aws-serverless-java-container-spring</artifactId>
</dependency>
Use the latest (or higher than 1.2).
https://github.com/awslabs/aws-serverless-java-container/pull/205
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With