Auto-generated OpenAPI

Every Kanject service exposes a Swagger UI at /swagger out of the box, fed by your XML comments and [ProducesResponseType] annotations. Wire it up in three lines:

csharp
// Program.cs — Kanject wires XML comments into Swagger automatically
builder.Services.AddSwaggerGen(options =>
{
    options.SwaggerDoc("v1", new OpenApiInfo
    {
        Version = "v1",
        Title = "My Service API",
        Description = "Generated from C# XML comments"
    });

    // Pulls every /// <summary>, <param>, <response> you wrote above
    var xmlFilename = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml";
    options.IncludeXmlComments(
        Path.Combine(AppContext.BaseDirectory, xmlFilename),
        includeControllerXmlComments: true);

    options.DescribeAllParametersInCamelCase();
});

What ships with it

  • JWT Bearer and API Key security schemes pre-registered
  • Enum values rendered as strings via EnumSchemaFilter
  • camelCase parameter names to match frontend conventions
  • Route prefix auto-detected for Lambda stage deployments