swagger-core
swagger-core copied to clipboard
Integration with AWS Lambda
Is there any way to integrate swagger-core with our AWS Lambda code? We expose methods via AWS API Gateway proxy+ style integration since we don't want to build separate docs on API Gateway. This seems like an extra step to us. It would be nice if we can serve our microservices directly and also generate OpenAPI spec file from the code. Is there any way?
public class Handler implements RequestHandler<APIGatewayProxyRequestEvent, APIGatewayProxyResponseEvent> {
@Override
public APIGatewayProxyResponseEvent handleRequest(APIGatewayProxyRequestEvent input, Context context) {
// Handle request here
String path = input.getPath();
return new APIGatewayProxyResponseEvent()
.withStatusCode(200)
.withHeaders(Collections.emptyMap())
.withBody(someStringOutput);
}
}