AWS Lambda (NET 6): no response #1541
-
I am developing AWS Lambda (NET 6) Web service. I have built, deploy it to AWS, added Gateway endpoints. Then run to test expecting Swagger page. But instead of it I received
I have checked the CLoudWatch records: there are all my log records from ConfigureServices, Configure , all my services started, Swagger too. But at the end of logs I see one :
My be it the reason of the problem? How to detect and fix the reason? What to check? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
@ZedZipDev Good morning. Could you please share the sample code solution for investigation? The question is more specific to configuring Swagger UI. Also refer Access Swagger UI in AWS Lambda via API Gateway — Deployed with the Serverless Framework as a guidance, which:
<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
services.AddSwaggerGen(swagger =>
{
swagger.SwaggerDoc("v1", new OpenApiInfo { Title = "Customers API" });
var xmlFile = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml";
var xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile);
swagger.IncludeXmlComments(xmlPath);
});
//Swagger
app.UseSwagger(c =>
{
c.RouteTemplate = "swagger/{documentName}/swagger.json";
});
app.UseSwaggerUI(c =>
{
c.SwaggerEndpoint("v1/swagger.json", "Customers API V1");
c.RoutePrefix = "swagger";
}); It would also be helpful to share full stack trace from your logs. Thanks, |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
@ZedZipDev Good morning. Could you please share the sample code solution for investigation? The question is more specific to configuring Swagger UI. Also refer Access Swagger UI in AWS Lambda via API Gateway — Deployed with the Serverless Framework as a guidance, which:
.csproj
file:AddSwaggerGen()
extension method to load the XML documentation: