MinimalApis.Extensions
MinimalApis.Extensions copied to clipboard
A set of extensions and helpers for working with ASP.NET Core Minimal APIs.
Currently, `Validated` can return a `null` value even if the parameter was declared as non-nullable. `RequestDelegateFactory` (i.e. the default binding logic in the framework) honors the nullability declared on the...
Essentially discriminated union results which can then be used to drive metadata for `ApiExplorer` and Swagger. ``` c# app.MapPost("/todos", async Task (Todo todo) => { if (!string.IsNullOrEmpty(todo.Title)) { await Task.Yield();...
Something like: ``` c# app.MapPost("/foo", (int bar) => { }) .WithParameter("bar", "Some description for the parameter here", BindingSource.Querystring, required: false); ```
e.g. ``` csharp app.MapGet("/foo", () => { }) .WithDescription("This is the API description that should show up in OpenAPI via ApiExplorer."); ```
Really feels like I should be code-genning these...
Lots of debt here.
Add an appropriate number of unit tests
See https://stackoverflow.com/questions/69739606/how-to-implement-response-caching-with-minimal-apis-in-net-6
Currently the DefaultBinder uses a null options value for its call to RequestDelegateFactory.Create. This means none of the services available within the application are made available to the binder, including...