Skip to content

Commit d82c754

Browse files
authored
Merge pull request #1256 from json-api-dotnet/merge-master-v5.1.2-into-openapi
Merge master v5.1.2 into openapi
2 parents 935fa2b + 8d50846 commit d82c754

File tree

73 files changed

+1518
-417
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+1518
-417
lines changed

.config/dotnet-tools.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
]
1010
},
1111
"regitlint": {
12-
"version": "6.2.1",
12+
"version": "6.3.10",
1313
"commands": [
1414
"regitlint"
1515
]
@@ -21,10 +21,16 @@
2121
]
2222
},
2323
"dotnet-reportgenerator-globaltool": {
24-
"version": "5.1.11",
24+
"version": "5.1.15",
2525
"commands": [
2626
"reportgenerator"
2727
]
28+
},
29+
"docfx": {
30+
"version": "2.60.2",
31+
"commands": [
32+
"docfx"
33+
]
2834
}
2935
}
3036
}

Directory.Build.props

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
<PropertyGroup>
33
<TargetFrameworkName>net6.0</TargetFrameworkName>
44
<AspNetVersion>6.0.*</AspNetVersion>
5-
<EFCoreVersion>6.0.*</EFCoreVersion>
6-
<EFCorePostgresVersion>6.0.*</EFCorePostgresVersion>
7-
<MicrosoftCodeAnalysisVersion>4.3.*</MicrosoftCodeAnalysisVersion>
5+
<EFCoreVersion>7.0.*</EFCoreVersion>
6+
<EFCorePostgresVersion>7.0.*</EFCorePostgresVersion>
7+
<MicrosoftCodeAnalysisVersion>4.4.*</MicrosoftCodeAnalysisVersion>
88
<HumanizerVersion>2.14.1</HumanizerVersion>
99
<SwashbuckleVersion>6.4.*</SwashbuckleVersion>
1010
<NSwagApiClientVersion>13.16.*</NSwagApiClientVersion>
1111
<MicrosoftApiClientVersion>6.0.*</MicrosoftApiClientVersion>
1212
<NewtonsoftJsonVersion>13.0.*</NewtonsoftJsonVersion>
13-
<JsonApiDotNetCoreVersionPrefix>5.1.1</JsonApiDotNetCoreVersionPrefix>
13+
<JsonApiDotNetCoreVersionPrefix>5.1.3</JsonApiDotNetCoreVersionPrefix>
1414
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)CodingGuidelines.ruleset</CodeAnalysisRuleSet>
1515
<WarningLevel>9999</WarningLevel>
1616
<Nullable>enable</Nullable>
@@ -37,8 +37,8 @@
3737

3838
<!-- Test Project Dependencies -->
3939
<PropertyGroup>
40-
<CoverletVersion>3.2.0</CoverletVersion>
41-
<MoqVersion>4.18.2</MoqVersion>
42-
<TestSdkVersion>17.4.0</TestSdkVersion>
40+
<CoverletVersion>3.2.*</CoverletVersion>
41+
<MoqVersion>4.18.*</MoqVersion>
42+
<TestSdkVersion>17.4.*</TestSdkVersion>
4343
</PropertyGroup>
4444
</Project>

appveyor.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,13 @@ for:
4646
# https://dotnet.github.io/docfx/tutorial/docfx_getting_started.html
4747
git checkout $env:APPVEYOR_REPO_BRANCH -q
4848
}
49-
choco install docfx -y
50-
if ($lastexitcode -ne 0) {
51-
throw "docfx install failed with exit code $lastexitcode."
52-
}
5349
after_build:
5450
- pwsh: |
5551
CD ./docs
5652
& ./generate-examples.ps1
57-
& docfx docfx.json
58-
if ($lastexitcode -ne 0) {
59-
throw "docfx build failed with exit code $lastexitcode."
53+
& dotnet docfx docfx.json
54+
if ($LastExitCode -ne 0) {
55+
throw "docfx failed with exit code $LastExitCode."
6056
}
6157
6258
# https://www.appveyor.com/docs/how-to/git-push/

benchmarks/Benchmarks.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</ItemGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="BenchmarkDotNet" Version="0.13.2" />
13+
<PackageReference Include="BenchmarkDotNet" Version="0.13.4" />
1414
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="$(MicrosoftCodeAnalysisVersion)" PrivateAssets="all">
1515
<!-- This reference solely exists to prevent build warnings for conflicting versions of Microsoft.CodeAnalysis. -->
1616
</PackageReference>

docs/README.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
11
# Intro
2-
Documentation for JsonApiDotNetCore is produced using [DocFX](https://dotnet.github.io/docfx/) from several files in this directory.
2+
Documentation for JsonApiDotNetCore is produced using [docfx](https://dotnet.github.io/docfx/) from several files in this directory.
33
In addition, the example request/response pairs are generated by executing `curl` commands against the GettingStarted project.
44

55
# Installation
6-
Run the following commands once to setup your system:
7-
8-
```
9-
choco install docfx -y
10-
```
11-
12-
```
13-
npm install -g httpserver
14-
```
6+
You need to have 'npm' installed. Download Node.js from https://nodejs.org/.
157

168
# Running
179
The next command regenerates the documentation website and opens it in your default browser:

docs/build-dev.ps1

Lines changed: 42 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,48 @@
1-
# This script assumes that you have already installed docfx and httpserver.
2-
# If that's not the case, run the next commands:
3-
# choco install docfx -y
4-
# npm install -g httpserver
1+
#Requires -Version 7.0
52

6-
Remove-Item _site -Recurse -ErrorAction Ignore
3+
# This script builds the documentation website, starts a web server and opens the site in your browser. Intended for local development.
74

8-
dotnet build .. --configuration Release
9-
Invoke-Expression ./generate-examples.ps1
5+
param(
6+
# Specify -NoBuild to skip code build and examples generation. This runs faster, so handy when only editing Markdown files.
7+
[switch] $NoBuild=$False
8+
)
109

11-
docfx ./docfx.json
12-
Copy-Item home/*.html _site/
13-
Copy-Item home/*.ico _site/
14-
Copy-Item -Recurse home/assets/* _site/styles/
10+
function VerifySuccessExitCode {
11+
if ($LastExitCode -ne 0) {
12+
throw "Command failed with exit code $LastExitCode."
13+
}
14+
}
15+
16+
function EnsureHttpServerIsInstalled {
17+
if ((Get-Command "npm" -ErrorAction SilentlyContinue) -eq $null) {
18+
throw "Unable to find npm in your PATH. please install Node.js first."
19+
}
20+
21+
npm list --depth 1 --global httpserver >$null
22+
23+
if ($LastExitCode -eq 1) {
24+
npm install -g httpserver
25+
}
26+
}
27+
28+
EnsureHttpServerIsInstalled
29+
VerifySuccessExitCode
30+
31+
if (-Not $NoBuild -Or -Not (Test-Path -Path _site)) {
32+
Remove-Item _site -Recurse -ErrorAction Ignore
33+
34+
dotnet build .. --configuration Release
35+
VerifySuccessExitCode
36+
37+
Invoke-Expression ./generate-examples.ps1
38+
}
39+
40+
dotnet docfx ./docfx.json
41+
VerifySuccessExitCode
42+
43+
Copy-Item -Force home/*.html _site/
44+
Copy-Item -Force home/*.ico _site/
45+
Copy-Item -Force -Recurse home/assets/* _site/styles/
1546

1647
cd _site
1748
$webServerJob = httpserver &

docs/generate-examples.ps1

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function Get-WebServer-ProcessId {
88
$processId = $(lsof -ti:14141)
99
}
1010
elseif ($IsWindows) {
11-
$processId = $(Get-NetTCPConnection -LocalPort 14141 -ErrorAction SilentlyContinue).OwningProcess
11+
$processId = $(Get-NetTCPConnection -LocalPort 14141 -ErrorAction SilentlyContinue).OwningProcess?[0]
1212
}
1313
else {
1414
throw [System.Exception] "Unsupported operating system."
@@ -22,7 +22,11 @@ function Kill-WebServer {
2222

2323
if ($processId -ne $null) {
2424
Write-Output "Stopping web server"
25-
Get-Process -Id $processId | Stop-Process
25+
Get-Process -Id $processId | Stop-Process -ErrorVariable stopErrorMessage
26+
27+
if ($stopErrorMessage) {
28+
throw "Failed to stop web server: $stopErrorMessage"
29+
}
2630
}
2731
}
2832

@@ -40,18 +44,21 @@ function Start-WebServer {
4044
Kill-WebServer
4145
Start-WebServer
4246

43-
Remove-Item -Force -Path .\request-examples\*.json
47+
try {
48+
Remove-Item -Force -Path .\request-examples\*.json
4449

45-
$scriptFiles = Get-ChildItem .\request-examples\*.ps1
46-
foreach ($scriptFile in $scriptFiles) {
47-
$jsonFileName = [System.IO.Path]::GetFileNameWithoutExtension($scriptFile.Name) + "_Response.json"
50+
$scriptFiles = Get-ChildItem .\request-examples\*.ps1
51+
foreach ($scriptFile in $scriptFiles) {
52+
$jsonFileName = [System.IO.Path]::GetFileNameWithoutExtension($scriptFile.Name) + "_Response.json"
4853

49-
Write-Output "Writing file: $jsonFileName"
50-
& $scriptFile.FullName > .\request-examples\$jsonFileName
54+
Write-Output "Writing file: $jsonFileName"
55+
& $scriptFile.FullName > .\request-examples\$jsonFileName
5156

52-
if ($LastExitCode -ne 0) {
53-
throw [System.Exception] "Example request from '$($scriptFile.Name)' failed with exit code $LastExitCode."
57+
if ($LastExitCode -ne 0) {
58+
throw [System.Exception] "Example request from '$($scriptFile.Name)' failed with exit code $LastExitCode."
59+
}
5460
}
5561
}
56-
57-
Kill-WebServer
62+
finally {
63+
Kill-WebServer
64+
}

0 commit comments

Comments
 (0)