Skip to content

Commit

Permalink
Prepare CHANGELOG and Set stable versions
Browse files Browse the repository at this point in the history
  • Loading branch information
ikyriak committed Aug 22, 2024
1 parent 34559e3 commit 0f74ab0
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 9 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ jobs:
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
3.1.x
5.0.x
6.0.x
7.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
Expand Down
49 changes: 49 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,55 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## [2.6.0] - 2024-08-22
- ⚙ IdempotentAPI.MinimalAPI `v3.2.0`: Add the option to configure special types in the `IIdempotencyOptionsProvider` to be excluded from the API actions (e.g., `[FromServices] DbContext context`). This will solve the self-referencing loop issue. For example, we can configure the `ExcludeRequestSpecialTypes` in the following way. Thank you, [@csimonsson](https://github.com/csimonsson), for reporting issue [#81](https://github.com/ikyriak/IdempotentAPI/issues/81) and help improving the code.

```c#
// Program.cs
// ...
builder.Services.AddIdempotentMinimalAPI(new IdempotencyOptionsProvider());
// ...
```
```c#
// IdempotencyOptionsProvider.cs
using IdempotentAPI.Core;
using IdempotentAPI.MinimalAPI;
using IdempotentAPI.TestWebMinimalAPIs.ApiContext;
using Microsoft.EntityFrameworkCore;

namespace IdempotentAPI.TestWebMinimalAPIs
{
public class IdempotencyOptionsProvider : IIdempotencyOptionsProvider
{
private readonly List<Type> ExcludeRequestSpecialTypes = new()
{
typeof(DbContext),
};

public IIdempotencyOptions GetIdempotencyOptions(IHttpContextAccessor httpContextAccessor)
{
// WARNING: This example implementation shows we can provide different IdempotencyOptions per case.
//switch (httpContextAccessor?.HttpContext?.Request.Path)
//{
// case "/v6/TestingIdempotentAPI/test":
// return new IdempotencyOptions()
// {
// ExpireHours = 1,
// ExcludeRequestSpecialTypes = ExcludeRequestSpecialTypes,
// };
//}
return new IdempotencyOptions()
{
ExcludeRequestSpecialTypes = ExcludeRequestSpecialTypes,
};
}
}
}
```


## [2.5.0] - 2024-07-10
- 🌟 Support [FastEndpoints](https://fast-endpoints.com/), a developer-friendly alternative to Minimal APIs and MVC. Thank you, [@CaptainPowerTurtle](https://github.com/CaptainPowerTurtle), for reporting issue [#72](https://github.com/ikyriak/IdempotentAPI/issues/72) and [@dj-nitehawk](https://github.com/dj-nitehawk) for helping me integrate with `FastEndpoints` 🙏💪.
-Add the option to configure the Newtonsoft `SerializerSettings` based on our needs. For example, this will enable us to use [NodaTime](https://nodatime.org/) in our DTOs. Thank you, [@angularsen](https://github.com/angularsen), for reporting the issue [#74](https://github.com/ikyriak/IdempotentAPI/issues/74) and sharing your ideas to improve the `IdempotentAPI` library 🙏.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Idempotent API (v2.5.0)
# Idempotent API (v2.6.0)



Expand Down Expand Up @@ -123,7 +123,7 @@ The following figure shows a simplified example of the `IdempotentAPI` library f
Let's see how we could use the NuGet packages in a Web API project. For more examples and code, you can check the [sample projects](https://github.com/ikyriak/IdempotentAPI/tree/master/samples). The `IdempotentAPI` can be installed via the NuGet UI or the NuGet package manager console:

```powershell
PM> Install-Package IdempotentAPI -Version 2.5.0
PM> Install-Package IdempotentAPI -Version 2.6.0
```

and, register the **IdempotentAPI Core services** for either controller-based APIs or minimal APIs.
Expand Down Expand Up @@ -151,7 +151,7 @@ OR
// Option 1: Define the default options:
builder.Services.AddIdempotentMinimalAPI(new IdempotencyOptions());

// Option 2: Configure the idempotent options by implementing the `IIdempotencyOptionsProvider` to provide the `IIdempotencyOptions` based on our needs (e.g., per endpoint).
// Option 2: Configure the idempotent options by implementing the `IIdempotencyOptionsProvider` to provide the `IIdempotencyOptions` based on our needs (e.g., per endpoint). For additional information, you can read the CHANGELOG.md.
builder.Services.AddIdempotentMinimalAPI(new IdempotencyOptionsProvider());
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>net7.0</TargetFramework>
<Authors>Ioannis Kyriakidis</Authors>
<Company>ikyriakidis.com</Company>
<Version>3.2.0-issue-81-01</Version>
<Version>3.2.0</Version>
<Description>IdempotentAPI support in Minimal APIs.</Description>
<PackageTags>cache;idempotent api;idempotency;asp.net core;attribute;middleware;rest</PackageTags>
<RepositoryUrl>https://github.com/ikyriak/IdempotentAPI.git</RepositoryUrl>
Expand Down
2 changes: 1 addition & 1 deletion src/IdempotentAPI/IdempotentAPI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>
<Authors>Ioannis Kyriakidis</Authors>
<Company>ikyriakidis.com</Company>
<Version>2.6.0-issue-81-01</Version>
<Version>2.6.0</Version>
<Description>IdempotentAPI is an ASP.NET Core attribute by which any HTTP write operations (POST and PATCH) can have effect only once for the given request data.</Description>
<PackageTags>idempotent api;idempotency;asp.net core;attribute;middleware;rest</PackageTags>
<RepositoryUrl>https://github.com/ikyriak/IdempotentAPI.git</RepositoryUrl>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using IdempotentAPI.Core;
using IdempotentAPI.MinimalAPI;
using IdempotentAPI.TestWebMinimalAPIs.ApiContext;
using Microsoft.EntityFrameworkCore;

namespace IdempotentAPI.TestWebMinimalAPIs
Expand All @@ -13,7 +12,6 @@ public class IdempotencyOptionsProvider : IIdempotencyOptionsProvider
private readonly List<Type> ExcludeRequestSpecialTypes = new()
{
typeof(DbContext),
typeof(ApiDbContext),
};

public IIdempotencyOptions GetIdempotencyOptions(IHttpContextAccessor httpContextAccessor)
Expand Down

0 comments on commit 0f74ab0

Please sign in to comment.