Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
8f49f7e
chore: migrate solution to .slnx format
Nov 18, 2025
31c4c7f
chore(deps): upgrade nuget packages, analyzers, coding rules and enab…
Nov 18, 2025
c5ec5e4
ci: upgrade pipelines
Nov 20, 2025
3763d8a
chore: update LangVersion to 14.0 and default TargetFramework to net10
Nov 20, 2025
674494c
style: consolidate method signatures and adopt primary constructors
Dec 3, 2025
5b386be
chore: migrate sample solution from .sln to .slnx format, upgrade nug…
Dec 3, 2025
af65a47
fix(sample): improve validation and fix nullable handling in request …
Dec 3, 2025
08af2fe
chore(sample): remove unused Azure options configuration
Dec 3, 2025
85134da
feat(sample): add Aspire AppHost for orchestration incl. Blazor Web U…
Dec 3, 2025
afe78f8
chore(test): migrate to Microsoft.Testing.Platform and xUnit v3
Dec 3, 2025
01a191e
feat(sample): add health check endpoint
Dec 3, 2025
b8200f8
chore(deps): upgrade aspire to 13.0.2
Dec 4, 2025
55ca145
fix(sample): ensure proper serialization in demo web
Dec 4, 2025
36a0a01
feat(validation): add nested [FromBody] property validation and tests
Dec 4, 2025
0660b25
fix(validation): prevent duplicate key errors and add merge tests
Dec 4, 2025
732caef
feat(sample): add Scalar API reference alongside Swagger UI
Dec 4, 2025
3540144
refactor(swagger): update filters for Microsoft.OpenApi v2.x compatib…
Dec 4, 2025
58e83ac
chore(deps): add Scalar.AspNetCore package reference
Dec 4, 2025
1b5abbb
docs: expand README with validation, Scalar, and .NET 10 guidance
Dec 4, 2025
db7ae76
chore(sample): use project reference instead of NuGet package
Dec 4, 2025
10c1e9d
chore(sample): suppress analyzer warnings and fix file endings
Dec 4, 2025
5c876c7
chore(deps): upgrade packages and consolidate test infrastructure
Dec 4, 2025
99b6d3c
chore: bump version to 2.0
Dec 4, 2025
d704349
docs: update readme
Dec 4, 2025
223988f
fix(swagger): resolve enum type lookup for duplicate names across ass…
Dec 5, 2025
a53071d
docs: update readme
Dec 5, 2025
b98c8c9
fix(middleware): prevent header modification after response started
Dec 5, 2025
e56ee18
docs(readme): fix incorrect GlobalErrorHandlingOptions class name
Dec 5, 2025
301c93e
docs(readme): remove duplicate UseSwagger call in Scalar example
Dec 5, 2025
cbb7b30
refactor(middleware): use pattern matching for exception type checking
Dec 5, 2025
d175852
feat(middleware): add exception mappings for ArgumentException and Ti…
Dec 5, 2025
553ada9
fix(middleware): skip error response for canceled requests
Dec 5, 2025
09c698d
fix(middleware): produce valid JSON in CreateMessage output
Dec 5, 2025
22c73bd
refactor(middleware): remove unnecessary null checks for exception pa…
Dec 5, 2025
4c8fa65
feat(middleware): add request path as Instance in ProblemDetails
Dec 5, 2025
4f24d4a
refactor(middleware): unify extension fields logic and add instance t…
Dec 5, 2025
a6e3d4a
fix(endpoints): filter null instances from Activator.CreateInstance
Dec 5, 2025
96f4ce7
fix(swagger): use TryParse for enum string parsing
Dec 5, 2025
1c3a37a
fix(validation): add bounds check for GenericTypeArguments access
Dec 5, 2025
e1f7c88
fix(sample): handle nullable fields and improve update handler
Dec 5, 2025
0946d76
test: add unit tests for Swagger filters and EndpointDefinitionExtens…
Dec 5, 2025
2a2e20d
fix(sample): make User response fields nullable to match entity
Dec 5, 2025
f772af3
fix(validation): use FirstOrDefault to avoid exception with multiple …
Dec 5, 2025
007c9ad
fix(validation): add null check for Activator.CreateInstance result
Dec 5, 2025
d972f14
fix(endpoints): handle Activator.CreateInstance exceptions gracefully
Dec 5, 2025
7be6e3d
fix(sample): make Address and Country record fields nullable
Dec 5, 2025
083a689
fix(samples): remove contradictory Required attribute from nullable W…
Dec 5, 2025
7279539
fix(extensions): add null guards to DictionaryExtensions.MergeErrors
Dec 5, 2025
6462682
fix(validators): remove NotNull requirement for optional WorkAddress
Dec 5, 2025
70f328a
feat(sample): implement partial updates and Gender validation
Dec 5, 2025
3a459c4
fix(sample): return BadRequest instead of throwing in DeleteUserByIdH…
Dec 5, 2025
e2653a1
fix(validation): handle Activator.CreateInstance exceptions in Valida…
Dec 5, 2025
ffc75ad
fix(sample): critical DI, exception handling, and mapping fixes
Dec 5, 2025
9984040
chore: upgrade to DotNet10 in atc-coding-rules-updater.json
Dec 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# ATC coding rules - https://github.com/atc-net/atc-coding-rules
# Version: 1.0.1
# Updated: 03-06-2024
# Version: 1.0.0
# Updated: 01-03-2025
# Location: Root
# Distribution: DotNet8
# Distribution: DotNet10
# Inspired by: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-style-rule-options

##########################################
Expand Down Expand Up @@ -464,11 +464,13 @@ dotnet_diagnostic.MA0048.severity = error # https://github.com/atc-net
dotnet_diagnostic.CA1014.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA1014.md
dotnet_diagnostic.CA1068.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA1068.md
dotnet_diagnostic.CA1305.severity = error
dotnet_diagnostic.CA1308.severity = suggestion # Normalize strings to uppercase
dotnet_diagnostic.CA1510.severity = suggestion # Use ArgumentNullException throw helper
dotnet_diagnostic.CA1511.severity = suggestion # Use ArgumentException throw helper
dotnet_diagnostic.CA1512.severity = suggestion # Use ArgumentOutOfRangeException throw helper
dotnet_diagnostic.CA1513.severity = suggestion # Use ObjectDisposedException throw helper
dotnet_diagnostic.CA1514.severity = error # Avoid redundant length argument
dotnet_diagnostic.CA1515.severity = suggestion # Because an application's API isn't typically referenced from outside the assembly, types can be made internal (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1515)
dotnet_diagnostic.CA1707.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA1707.md
dotnet_diagnostic.CA1812.severity = none
dotnet_diagnostic.CA1822.severity = suggestion
Expand All @@ -490,6 +492,8 @@ dotnet_diagnostic.CA1867.severity = suggestion # Use char overload
dotnet_diagnostic.CA1868.severity = suggestion # Unnecessary call to 'Contains(item)'
dotnet_diagnostic.CA1869.severity = suggestion # Cache and reuse 'JsonSerializerOptions' instances
dotnet_diagnostic.CA1870.severity = suggestion # Use a cached 'SearchValues' instance
dotnet_diagnostic.CA1871.severity = suggestion # Do not pass a nullable struct to 'ArgumentNullException.ThrowIfNull'
dotnet_diagnostic.CA1872.severity = suggestion # Prefer 'Convert.ToHexString' and 'Convert.ToHexStringLower' over call chains based on 'BitConverter.ToString'
dotnet_diagnostic.CA2007.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA2007.md
dotnet_diagnostic.CA2017.severity = error # Parameter count mismatch
dotnet_diagnostic.CA2018.severity = error # The count argument to Buffer.BlockCopy should specify the number of bytes to copy
Expand All @@ -503,8 +507,20 @@ dotnet_diagnostic.CA2255.severity = suggestion # The ModuleInitializer attr
dotnet_diagnostic.CA2259.severity = error # Ensure ThreadStatic is only used with static fields
dotnet_diagnostic.CA2260.severity = error # Implement generic math interfaces correctly
dotnet_diagnostic.CA2261.severity = error # Do not use ConfigureAwaitOptions.SuppressThrowing with Task<TResult>
dotnet_diagnostic.CA2262.severity = suggestion # Set 'MaxResponseHeadersLength' properly
dotnet_diagnostic.CA2263.severity = suggestion # Prefer generic overload when type is known
dotnet_diagnostic.CA2264.severity = error # Do not pass a non-nullable value to 'ArgumentNullException.ThrowIfNull'
dotnet_diagnostic.IDE0005.severity = warning # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/IDE0005.md
dotnet_diagnostic.IDE0010.severity = suggestion # Populate switch
dotnet_diagnostic.IDE0028.severity = suggestion # Collection initialization can be simplified
dotnet_diagnostic.IDE0021.severity = suggestion # Use expression body for constructor
dotnet_diagnostic.IDE0055.severity = none # Fix formatting
dotnet_diagnostic.IDE0058.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/IDE0058.md
dotnet_diagnostic.IDE0061.severity = suggestion # Use expression body for local function
dotnet_diagnostic.IDE0130.severity = suggestion # Namespace does not match folder structure
dotnet_diagnostic.IDE0290.severity = none # Use primary constructor
dotnet_diagnostic.IDE0301.severity = suggestion # Use collection expression for empty
dotnet_diagnostic.IDE0305.severity = suggestion # Collection initialization can be simplified


# Microsoft - Compiler Errors
Expand All @@ -519,6 +535,7 @@ dotnet_diagnostic.CS4014.severity = error # https://github.com/atc-net/
# StyleCop
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers
dotnet_diagnostic.SA1009.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1009.md
dotnet_diagnostic.SA1010.severity = none # False positive when using collection initializers
dotnet_diagnostic.SA1101.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1101.md
dotnet_diagnostic.SA1122.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1122.md
dotnet_diagnostic.SA1133.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1133.md
Expand All @@ -541,9 +558,11 @@ dotnet_diagnostic.SA1649.severity = error # https://github.com/atc-net
# https://rules.sonarsource.com/csharp
dotnet_diagnostic.S1135.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/SonarAnalyzerCSharp/S1135.md
dotnet_diagnostic.S2629.severity = none # Don't use string interpolation in logging message templates.
dotnet_diagnostic.S3358.severity = none # Extract this nested ternary operation into an independent statement.
dotnet_diagnostic.S6602.severity = none # "Find" method should be used instead of the "FirstOrDefault"
dotnet_diagnostic.S6603.severity = none # The collection-specific "TrueForAll" method should be used instead of the "All"
dotnet_diagnostic.S6605.severity = none # Collection-specific "Exists" method should be used instead of the "Any"
dotnet_diagnostic.S6964.severity = none # Value type property used as input in a controller action should be nullable, required or annotated with the JsonRequiredAttribute to avoid under-posting.


##########################################
Expand Down
29 changes: 5 additions & 24 deletions .github/workflows/post-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: πŸ›’ Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0
token: ${{ secrets.PAT_WORKFLOWS }}
Expand All @@ -30,16 +30,10 @@ jobs:
with:
setAllVars: true

- name: βš™οΈ Setup dotnet 8.0.x
uses: actions/setup-dotnet@v4
- name: βš™οΈ Setup dotnet 10.0.x
uses: actions/setup-dotnet@v5
with:
dotnet-version: '8.0.x'

- name: βš™οΈ Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'zulu'
dotnet-version: '10.0.x'

- name: 🧹 Clean
run: dotnet clean -c Release && dotnet nuget locals all --clear
Expand All @@ -51,20 +45,7 @@ jobs:
run: dotnet build -c Release --no-restore /p:UseSourceLink=true

- name: πŸ§ͺ Run unit tests
run: dotnet test -c Release --no-build --filter "Category!=Integration"

- name: 🌩️ SonarCloud install scanner
run: dotnet tool install --global dotnet-sonarscanner

- name: 🌩️ SonarCloud analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
shell: pwsh
run: |
dotnet sonarscanner begin /k:"atc-net_atc-rest-minimalapi" /o:"atc-net" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
dotnet build -c Release /p:UseSourceLink=true --no-restore
dotnet sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
run: dotnet test -c Release --no-build --filter-query "/[category!=integration]" --ignore-exit-code 8

- name: ⏩ Merge to stable-branch
run: |
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/pre-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: πŸ›’ Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0

- name: βš™οΈ Setup dotnet 8.0.x
uses: actions/setup-dotnet@v4
- name: βš™οΈ Setup dotnet 10.0.x
uses: actions/setup-dotnet@v5
with:
dotnet-version: '8.0.x'
dotnet-version: '10.0.x'

- name: 🧹 Clean
run: dotnet clean -c Release && dotnet nuget locals all --clear
Expand All @@ -39,14 +39,14 @@ jobs:
- dotnet-build
steps:
- name: πŸ›’ Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0

- name: βš™οΈ Setup dotnet 8.0.x
uses: actions/setup-dotnet@v4
- name: βš™οΈ Setup dotnet 10.0.x
uses: actions/setup-dotnet@v5
with:
dotnet-version: '8.0.x'
dotnet-version: '10.0.x'

- name: πŸ” Restore packages
run: dotnet restore
Expand All @@ -55,4 +55,4 @@ jobs:
run: dotnet build -c Release --no-restore /p:UseSourceLink=true

- name: πŸ§ͺ Run unit tests
run: dotnet test -c Release --no-build --filter "Category!=Integration"
run: dotnet test -c Release --no-build --filter-query "/[category!=integration]" --ignore-exit-code 8
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: πŸ›’ Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0
token: ${{ secrets.PAT_WORKFLOWS }}
Expand All @@ -27,10 +27,10 @@ jobs:
with:
setAllVars: true

- name: βš™οΈ Setup dotnet 8.0.x
uses: actions/setup-dotnet@v4
- name: βš™οΈ Setup dotnet 10.0.x
uses: actions/setup-dotnet@v5
with:
dotnet-version: '8.0.x'
dotnet-version: '10.0.x'

- name: 🧹 Clean
run: dotnet clean -c Release && dotnet nuget locals all --clear
Expand Down
94 changes: 0 additions & 94 deletions Atc.Rest.MinimalApi.sln

This file was deleted.

24 changes: 24 additions & 0 deletions Atc.Rest.MinimalApi.slnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<Solution>
<Folder Name="/docs/">
<File Path="README.md" />
</Folder>
<Folder Name="/sample/" />
<Folder Name="/sample/src/">
<Project Path="sample/src/Demo.Api.Contracts/Demo.Api.Contracts.csproj" />
<Project Path="sample/src/Demo.Api/Demo.Api.csproj" />
<Project Path="sample/src/Demo.AppHost/Demo.AppHost.csproj" />
<Project Path="sample/src/Demo.Domain/Demo.Domain.csproj" />
<Project Path="sample/src/Demo.Web/Demo.Web.csproj" />
</Folder>
<Folder Name="/sample/test/">
<Project Path="sample/test/Demo.Api.Contracts.Tests/Demo.Api.Contracts.Tests.csproj" />
<Project Path="sample/test/Demo.Api.IntegrationTests/Demo.Api.IntegrationTests.csproj" />
<Project Path="sample/test/Demo.Domain.Tests/Demo.Domain.Tests.csproj" />
</Folder>
<Folder Name="/src/">
<Project Path="src/Atc.Rest.MinimalApi/Atc.Rest.MinimalApi.csproj" />
</Folder>
<Folder Name="/test/">
<Project Path="test/Atc.Rest.MinimalApi.Tests/Atc.Rest.MinimalApi.Tests.csproj" />
</Folder>
</Solution>
9 changes: 5 additions & 4 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

<PropertyGroup Label="Compile settings">
<Nullable>enable</Nullable>
<LangVersion>12.0</LangVersion>
<LangVersion>14.0</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>1573,1591,1712,CA1014,NU5104</NoWarn>

Expand All @@ -45,12 +45,13 @@

<!-- Shared code analyzers used for all projects in the solution -->
<ItemGroup Label="Code Analyzers">
<PackageReference Include="Atc.Analyzer" Version="0.1.15" PrivateAssets="All" />
<PackageReference Include="AsyncFixer" Version="1.6.0" PrivateAssets="All" />
<PackageReference Include="Asyncify" Version="0.9.7" PrivateAssets="All" />
<PackageReference Include="Meziantou.Analyzer" Version="2.0.163" PrivateAssets="All" />
<PackageReference Include="Meziantou.Analyzer" Version="2.0.257" PrivateAssets="All" />
<PackageReference Include="SecurityCodeScan.VS2019" Version="5.6.7" PrivateAssets="All" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.507" PrivateAssets="All" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.32.0.97167" PrivateAssets="All" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="10.16.1.129956" PrivateAssets="All" />
</ItemGroup>

</Project>
Loading