Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"jetbrains.resharper.globaltools": {
"version": "2025.2.0",
"version": "2025.2.3",
"commands": [
"jb"
],
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ jobs:
# Get the version suffix from the auto-incrementing build number. For example: '123' => 'master-00123'
$revision = "{0:D5}" -f [convert]::ToInt32($env:GITHUB_RUN_NUMBER, 10)
$branchName = ![string]::IsNullOrEmpty($env:GITHUB_HEAD_REF) ? $env:GITHUB_HEAD_REF : $env:GITHUB_REF_NAME
$safeName = $branchName.Replace('/', '-').Replace('_', '-')
$versionSuffix = "$safeName-$revision"
$safeBranchName = $($branchName -Replace '[^a-zA-Z0-9-]', '-')[0..40] -Join ""
$versionSuffix = "$safeBranchName-$revision"
}
Write-Output "Using version suffix: $versionSuffix"
Write-Output "PACKAGE_VERSION_SUFFIX=$versionSuffix" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Expand Down Expand Up @@ -197,7 +197,7 @@ jobs:
Write-Output "Running code cleanup on commit range $baseCommitHash..$headCommitHash in pull request."
dotnet regitlint -s JsonApiDotNetCore.MongoDb.sln --print-command --skip-tool-check --max-runs=5 --jb --dotnetcoresdk=$(dotnet --version) --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --properties:RunAnalyzers=false --jb --verbosity=WARN -f commits -a $headCommitHash -b $baseCommitHash --fail-on-diff --print-diff
- name: CleanupCode (on branch)
if: ${{ github.event_name == 'push' || github.event_name == 'release' }}
if: ${{ github.event_name == 'push' || github.event_name == 'release' || github.event_name == 'workflow_dispatch' }}
shell: pwsh
run: |
Write-Output 'Running code cleanup on all files.'
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AnalysisMode>Recommended</AnalysisMode>
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)CodingGuidelines.ruleset</CodeAnalysisRuleSet>
<RunSettingsFilePath>$(MSBuildThisFileDirectory)tests.runsettings</RunSettingsFilePath>
<VersionPrefix>5.7.2</VersionPrefix>
<VersionPrefix>5.9.0</VersionPrefix>
<VersionSuffix>pre</VersionSuffix>
<NuGetAuditMode>direct</NuGetAuditMode>
</PropertyGroup>
Expand Down
6 changes: 3 additions & 3 deletions package-versions.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<!-- Published dependencies (only update on major version change) -->
<JsonApiDotNetCoreFrozenVersion>5.7.1</JsonApiDotNetCoreFrozenVersion>
<JsonApiDotNetCoreFrozenVersion>5.9.0</JsonApiDotNetCoreFrozenVersion>
<MongoDBDriverFrozenVersion>3.3.0</MongoDBDriverFrozenVersion>

<!-- Non-published dependencies (these are safe to update, won't cause a breaking change) -->
Expand All @@ -11,8 +11,8 @@
<FluentAssertionsVersion>7.2.*</FluentAssertionsVersion>
<GitHubActionsTestLoggerVersion>2.4.*</GitHubActionsTestLoggerVersion>
<InheritDocVersion>2.0.*</InheritDocVersion>
<MongoDBDriverVersion>3.3.*</MongoDBDriverVersion>
<TestSdkVersion>17.14.*</TestSdkVersion>
<MongoDBDriverVersion>3.5.*</MongoDBDriverVersion>
<TestSdkVersion>18.0.*</TestSdkVersion>
<XunitVersion>2.9.*</XunitVersion>
<XunitVisualStudioVersion>3.1.*</XunitVisualStudioVersion>
</PropertyGroup>
Expand Down
53 changes: 53 additions & 0 deletions src/Examples/GettingStarted/GettingStarted.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
@hostAddress = http://localhost:24141

### Get all books.

GET {{hostAddress}}/api/books

### Get the first two books.

GET {{hostAddress}}/api/books?page[size]=2

### Filter books whose title contains whitespace, sort descending by publication year.

GET {{hostAddress}}/api/books?filter=contains(title,'%20')&sort=-publishYear

### Get only the titles of all books.

GET {{hostAddress}}/api/books?fields[books]=title

### Create a new book.

POST {{hostAddress}}/api/books
Content-Type: application/vnd.api+json

{
"data": {
"type": "books",
"attributes": {
"title": "Getting started with JSON:API",
"author": "John Doe",
"publishYear": 2000
}
}
}

### Change the publication year and author of the book with ID 68f86594c8555269227c26d2.

PATCH {{hostAddress}}/api/books/68f86594c8555269227c26d2
Content-Type: application/vnd.api+json

{
"data": {
"type": "books",
"id": "68f86594c8555269227c26d2",
"attributes": {
"publishYear": 1820,
"author": "Jane Doe"
}
}
}

### Delete the book with ID 68f86594c8555269227c26d2.

DELETE {{hostAddress}}/api/books/68f86594c8555269227c26d2
3 changes: 2 additions & 1 deletion test/TestBuildingBlocks/FluentExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ public static StrongReferenceTypeAssertions<T> RefShould<T>([SysNotNull] this T?
return new StrongReferenceTypeAssertions<T>(actualValue);
}

public static void With<T>(this T subject, [InstantHandle] Action<T> continuation)
public static T With<T>(this T subject, [InstantHandle] Action<T> continuation)
{
continuation(subject);
return subject;
}

public sealed class StrongReferenceTypeAssertions<TReference>(TReference subject)
Expand Down
4 changes: 2 additions & 2 deletions test/TestBuildingBlocks/IntegrationTestContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public IntegrationTestContext()
_lazyFactory = new Lazy<WebApplicationFactory<TStartup>>(CreateFactory);
}

private IMongoRunner StartMongoDb()
private static IMongoRunner StartMongoDb()
{
return MongoRunnerProvider.Instance.Get();
}
Expand Down Expand Up @@ -118,7 +118,7 @@ private WebApplicationFactory<TStartup> CreateFactory()
return factory;
}

private void ConfigureJsonApiOptions(JsonApiOptions options)
private static void ConfigureJsonApiOptions(JsonApiOptions options)
{
options.IncludeExceptionStackTraceInErrors = true;
options.IncludeRequestBodyInErrors = true;
Expand Down
Loading