elsa-workflows / elsa-workflows/elsa-core
Elsa API is hiding my endpoints in swagger
- Dominant language
- C#
- Stars
- 7.9k
- Forks
- 1.5k
- Avg merge
- 15h 22m
- Merged PRs (30d)
- 114
Description
Hello,
It seems like Elsa is hiding my own endpoints:
I created a simple Minimal API with .Net8.
I integrated Elsa 3 API with my own endpoints.
Here is my code:
```cs
public static void Main(string[] args)
{
var builder = WebApplication.CreateBuilder(args);
builder.Services.SwaggerDocument(o =>
{
o.DocumentSettings = s =>
{
s.DocumentName = "My API";
s.Title = "My API";
s.Version = "v1";
};
});
builder.Services.AddElsa(elsa =>
{
elsa.UseWorkflowsApi();
elsa.AddSwagger();
});
var app = builder.Build();
app.UseWorkflowsApi();
app.UseSwaggerUI();
app.Run();
}
```
I use FastEndpoints to create my own endpoints
```cs
public class FastEndpointsV1 : Endpoint
{
public override void Configure()
{
Get("orch/aaa");
AllowAnonymous();
Version(1);
}
public override async Task HandleAsync(MyRequest req, CancellationToken ct)
{
await SendAsync(new MyResponse
{
Name = Guid.NewGuid().ToString(),
});
}
}
```
My question is: Is this possible ?
My second question: Is it possible to integrate Elsa endpoints without FastEndpoints ? just by using MinimalAPI's mapping ?
Contributor guide
Assessment
This issue has not been assessed yet.