Skip to content

Commit 526d03f

Browse files
authored
Merge pull request #1229 from json-api-dotnet/merge-openapi-into-1185
Merge openapi branch into PR 1185: Support NRT and MSV in required and nullable
2 parents fc15912 + d72e43e commit 526d03f

File tree

378 files changed

+3298
-1336
lines changed

Some content is hidden

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

378 files changed

+3298
-1336
lines changed

.config/dotnet-tools.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
"isRoot": true,
44
"tools": {
55
"jetbrains.resharper.globaltools": {
6-
"version": "2021.3.4",
6+
"version": "2022.2.4",
77
"commands": [
88
"jb"
99
]
1010
},
1111
"regitlint": {
12-
"version": "6.1.1",
12+
"version": "6.2.1",
1313
"commands": [
1414
"regitlint"
1515
]
@@ -21,7 +21,7 @@
2121
]
2222
},
2323
"dotnet-reportgenerator-globaltool": {
24-
"version": "5.1.3",
24+
"version": "5.1.11",
2525
"commands": [
2626
"reportgenerator"
2727
]

.editorconfig

+33-29
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,24 @@ indent_style = space
66
indent_size = 4
77
charset = utf-8
88
trim_trailing_whitespace = true
9-
end_of_line = lf
109
insert_final_newline = true
1110

12-
[*.{csproj,json}]
11+
[*.{config,csproj,css,js,json,props,ruleset,xslt}]
1312
indent_size = 2
1413

1514
[test/OpenApiClientTests/obj/*.{cs}]
1615
# Ignore compiler warnings triggered by code auto-generated by NSWag
1716
dotnet_diagnostic.CS8625.severity = suggestion
1817

1918
[*.{cs}]
20-
#### .NET Coding Conventions ####
19+
#### C#/.NET Coding Conventions ####
2120

22-
# Organize usings
21+
# 'using' directive preferences
2322
dotnet_sort_system_directives_first = true
23+
csharp_using_directive_placement = outside_namespace:suggestion
24+
25+
# Namespace declarations
26+
csharp_style_namespace_declarations = file_scoped:suggestion
2427

2528
# this. preferences
2629
dotnet_style_qualification_for_field = false:suggestion
@@ -34,13 +37,15 @@ dotnet_style_predefined_type_for_member_access = true:suggestion
3437

3538
# Modifier preferences
3639
dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion
40+
csharp_preferred_modifier_order = public, private, protected, internal, new, static, abstract, virtual, sealed, readonly, override, extern, unsafe, volatile, async:suggestion
3741
csharp_style_pattern_local_over_anonymous_function = false:silent
3842

3943
# Expression-level preferences
4044
dotnet_style_operator_placement_when_wrapping = end_of_line
4145
dotnet_style_prefer_auto_properties = true:suggestion
4246
dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion
4347
dotnet_style_prefer_conditional_expression_over_return = true:suggestion
48+
csharp_style_unused_value_expression_statement_preference = discard_variable:suggestion
4449

4550
# Parameter preferences
4651
dotnet_code_quality_unused_parameters = non_public:suggestion
@@ -58,38 +63,38 @@ csharp_style_expression_bodied_properties = true:suggestion
5863
# Code-block preferences
5964
csharp_prefer_braces = true:suggestion
6065

61-
# Expression-level preferences
62-
csharp_style_unused_value_expression_statement_preference = discard_variable:suggestion
63-
64-
# 'using' directive preferences
65-
csharp_using_directive_placement = outside_namespace:suggestion
66-
67-
68-
#### C# Formatting Rules ####
69-
7066
# Indentation preferences
7167
csharp_indent_case_contents_when_block = false
7268

7369
# Wrapping preferences
7470
csharp_preserve_single_line_statements = false
7571

72+
# 'var' usage preferences
73+
csharp_style_var_for_built_in_types = false:suggestion
74+
csharp_style_var_when_type_is_apparent = true:suggestion
75+
csharp_style_var_elsewhere = false:suggestion
76+
77+
# Parentheses preferences
78+
dotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary:suggestion
79+
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:suggestion
80+
dotnet_style_parentheses_in_relational_binary_operators = never_if_unnecessary:suggestion
7681

77-
#### Naming styles ####
82+
#### Naming Style ####
7883

7984
dotnet_diagnostic.IDE1006.severity = warning
8085

8186
# Naming rules
82-
dotnet_naming_rule.private_const_fields_should_be_pascal_case.symbols = private_const_fields
83-
dotnet_naming_rule.private_const_fields_should_be_pascal_case.style = pascal_case
84-
dotnet_naming_rule.private_const_fields_should_be_pascal_case.severity = warning
87+
dotnet_naming_rule.const_fields_should_be_pascal_case.symbols = const_fields
88+
dotnet_naming_rule.const_fields_should_be_pascal_case.style = pascal_case
89+
dotnet_naming_rule.const_fields_should_be_pascal_case.severity = warning
8590

8691
dotnet_naming_rule.private_static_readonly_fields_should_be_pascal_case.symbols = private_static_readonly_fields
8792
dotnet_naming_rule.private_static_readonly_fields_should_be_pascal_case.style = pascal_case
8893
dotnet_naming_rule.private_static_readonly_fields_should_be_pascal_case.severity = warning
8994

90-
dotnet_naming_rule.private_static_or_readonly_fields_should_start_with_underscore.symbols = private_static_or_readonly_fields
91-
dotnet_naming_rule.private_static_or_readonly_fields_should_start_with_underscore.style = camel_case_prefix_with_underscore
92-
dotnet_naming_rule.private_static_or_readonly_fields_should_start_with_underscore.severity = warning
95+
dotnet_naming_rule.private_fields_should_start_with_underscore.symbols = private_fields
96+
dotnet_naming_rule.private_fields_should_start_with_underscore.style = camel_case_prefix_with_underscore
97+
dotnet_naming_rule.private_fields_should_start_with_underscore.severity = warning
9398

9499
dotnet_naming_rule.locals_and_parameters_should_be_camel_case.symbols = locals_and_parameters
95100
dotnet_naming_rule.locals_and_parameters_should_be_camel_case.style = camel_case
@@ -100,25 +105,24 @@ dotnet_naming_rule.types_and_members_should_be_pascal_case.style = pascal_case
100105
dotnet_naming_rule.types_and_members_should_be_pascal_case.severity = warning
101106

102107
# Symbol specifications
103-
dotnet_naming_symbols.private_const_fields.applicable_kinds = field
104-
dotnet_naming_symbols.private_const_fields.applicable_accessibilities = private
105-
dotnet_naming_symbols.private_const_fields.required_modifiers = const
108+
dotnet_naming_symbols.const_fields.applicable_kinds = field
109+
dotnet_naming_symbols.const_fields.applicable_accessibilities = *
110+
dotnet_naming_symbols.const_fields.required_modifiers = const
106111

107112
dotnet_naming_symbols.private_static_readonly_fields.applicable_kinds = field
108113
dotnet_naming_symbols.private_static_readonly_fields.applicable_accessibilities = private
109-
dotnet_naming_symbols.private_static_readonly_fields.required_modifiers = static,readonly
114+
dotnet_naming_symbols.private_static_readonly_fields.required_modifiers = static, readonly
110115

111-
dotnet_naming_symbols.private_static_or_readonly_fields.applicable_kinds = field
112-
dotnet_naming_symbols.private_static_or_readonly_fields.applicable_accessibilities = private
113-
dotnet_naming_symbols.private_static_or_readonly_fields.required_modifiers = static readonly
116+
dotnet_naming_symbols.private_fields.applicable_kinds = field
117+
dotnet_naming_symbols.private_fields.applicable_accessibilities = private
114118

115-
dotnet_naming_symbols.locals_and_parameters.applicable_kinds = local,parameter
119+
dotnet_naming_symbols.locals_and_parameters.applicable_kinds = local, parameter
116120
dotnet_naming_symbols.locals_and_parameters.applicable_accessibilities = *
117121

118122
dotnet_naming_symbols.types_and_members.applicable_kinds = *
119123
dotnet_naming_symbols.types_and_members.applicable_accessibilities = *
120124

121-
# Naming styles
125+
# Style specifications
122126
dotnet_naming_style.pascal_case.capitalization = pascal_case
123127

124128
dotnet_naming_style.camel_case_prefix_with_underscore.required_prefix = _

.gitignore

+64-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## Ignore Visual Studio temporary files, build results, and
22
## files generated by popular Visual Studio add-ons.
33
##
4-
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
4+
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
55

66
# User-specific files
77
*.rsuser
@@ -90,16 +90,14 @@ StyleCopReport.xml
9090
*.tmp_proj
9191
*_wpftmp.csproj
9292
*.log
93+
*.tlog
9394
*.vspscc
9495
*.vssscc
9596
.builds
9697
*.pidb
9798
*.svclog
9899
*.scc
99100

100-
# MacOS file systems
101-
**/.DS_STORE
102-
103101
# Chutzpah Test files
104102
_Chutzpah*
105103

@@ -134,9 +132,6 @@ _ReSharper*/
134132
*.[Rr]e[Ss]harper
135133
*.DotSettings.user
136134

137-
# JetBrains Rider
138-
.idea/
139-
140135
# TeamCity is a build add-in
141136
_TeamCity*
142137

@@ -148,7 +143,9 @@ _TeamCity*
148143
!.axoCover/settings.json
149144

150145
# Coverlet is a free, cross platform Code Coverage Tool
151-
coverage*[.json, .xml, .info]
146+
coverage*.json
147+
coverage*.xml
148+
coverage*.info
152149

153150
# Visual Studio code coverage results
154151
*.coverage
@@ -297,6 +294,17 @@ node_modules/
297294
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
298295
*.vbw
299296

297+
# Visual Studio 6 auto-generated project file (contains which files were open etc.)
298+
*.vbp
299+
300+
# Visual Studio 6 workspace and project file (working project files containing files to include in project)
301+
*.dsw
302+
*.dsp
303+
304+
# Visual Studio 6 technical files
305+
*.ncb
306+
*.aps
307+
300308
# Visual Studio LightSwitch build output
301309
**/*.HTMLClient/GeneratedArtifacts
302310
**/*.DesktopClient/GeneratedArtifacts
@@ -353,6 +361,9 @@ ASALocalRun/
353361
# Local History for Visual Studio
354362
.localhistory/
355363

364+
# Visual Studio History (VSHistory) files
365+
.vshistory/
366+
356367
# BeatPulse healthcheck temp database
357368
healthchecksdb
358369

@@ -365,5 +376,50 @@ MigrationBackup/
365376
# Fody - auto-generated XML schema
366377
FodyWeavers.xsd
367378

379+
# VS Code files for those working on multiple tools
380+
.vscode/*
381+
!.vscode/settings.json
382+
!.vscode/tasks.json
383+
!.vscode/launch.json
384+
!.vscode/extensions.json
385+
*.code-workspace
386+
387+
# Local History for Visual Studio Code
388+
.history/
389+
390+
# Windows Installer files from build outputs
391+
*.cab
392+
*.msi
393+
*.msix
394+
*.msm
395+
*.msp
396+
397+
# JetBrains Rider
398+
*.sln.iml
399+
400+
#############################################
401+
### Additions specific to this repository ###
402+
#############################################
403+
404+
# MacOS file systems
405+
**/.DS_STORE
406+
368407
# Sqlite example databases
369408
*.db
409+
410+
# JetBrains IDEs Rider/IntelliJ (based on https://intellij-support.jetbrains.com/hc/en-us/articles/206544839)
411+
**/.idea/**/*.xml
412+
**/.idea/**/*.iml
413+
**/.idea/**/*.ids
414+
**/.idea/**/*.ipr
415+
**/.idea/**/*.iws
416+
**/.idea/**/*.name
417+
**/.idea/**/*.properties
418+
**/.idea/**/*.ser
419+
**/.idea/**/shelf/
420+
**/.idea/**/dictionaries/
421+
**/.idea/**/libraries/
422+
**/.idea/**/artifacts/
423+
**/.idea/**/httpRequests/
424+
**/.idea/**/dataSources/
425+
!**/.idea/**/codeStyles/*

.idea/.idea.JsonApiDotNetCore/.idea/.gitignore

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.idea.JsonApiDotNetCore/.idea/codeStyles/Project.xml

+20
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.idea.JsonApiDotNetCore/.idea/codeStyles/codeStyleConfig.xml

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Build.ps1

+7-5
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ function CheckLastExitCode {
88

99
function RunInspectCode {
1010
$outputPath = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), 'jetbrains-inspectcode-results.xml')
11-
# passing --build instead of --no-build as workaround for https://youtrack.jetbrains.com/issue/RSRP-487054
12-
dotnet jb inspectcode JsonApiDotNetCore.sln --build --output="$outputPath" --profile=WarningSeverities.DotSettings --properties:Configuration=Release --severity=WARNING --verbosity=WARN -dsl=GlobalAll -dsl=GlobalPerProduct -dsl=SolutionPersonal -dsl=ProjectPersonal
11+
dotnet jb inspectcode JsonApiDotNetCore.sln --no-build --output="$outputPath" --profile=WarningSeverities.DotSettings --properties:Configuration=Release --severity=WARNING --verbosity=WARN -dsl=GlobalAll -dsl=GlobalPerProduct -dsl=SolutionPersonal -dsl=ProjectPersonal
1312
CheckLastExitCode
1413

1514
[xml]$xml = Get-Content "$outputPath"
@@ -52,7 +51,7 @@ function RunCleanupCode {
5251

5352
if ($baseCommitHash -ne $headCommitHash) {
5453
Write-Output "Running code cleanup on commit range $baseCommitHash..$headCommitHash in pull request."
55-
dotnet regitlint -s JsonApiDotNetCore.sln --print-command --skip-tool-check --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --verbosity=WARN -f commits -a $headCommitHash -b $baseCommitHash --fail-on-diff --print-diff
54+
dotnet regitlint -s JsonApiDotNetCore.sln --print-command --skip-tool-check --max-runs=5 --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --verbosity=WARN -f commits -a $headCommitHash -b $baseCommitHash --fail-on-diff --print-diff
5655
CheckLastExitCode
5756
}
5857
}
@@ -114,8 +113,11 @@ CheckLastExitCode
114113
dotnet build -c Release
115114
CheckLastExitCode
116115

117-
RunInspectCode
118-
RunCleanupCode
116+
# https://youtrack.jetbrains.com/issue/RSRP-488628/Breaking-InspectCode-fails-with-Roslyn-Worker-process-exited-unexpectedly-after-update
117+
if ($IsWindows) {
118+
RunInspectCode
119+
RunCleanupCode
120+
}
119121

120122
dotnet test -c Release --no-build --collect:"XPlat Code Coverage"
121123
CheckLastExitCode

Directory.Build.props

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<NSwagApiClientVersion>13.16.*</NSwagApiClientVersion>
1111
<MicrosoftApiClientVersion>6.0.*</MicrosoftApiClientVersion>
1212
<NewtonsoftJsonVersion>13.0.*</NewtonsoftJsonVersion>
13-
<JsonApiDotNetCoreVersionPrefix>5.0.4</JsonApiDotNetCoreVersionPrefix>
13+
<JsonApiDotNetCoreVersionPrefix>5.1.1</JsonApiDotNetCoreVersionPrefix>
1414
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)CodingGuidelines.ruleset</CodeAnalysisRuleSet>
1515
<WarningLevel>9999</WarningLevel>
1616
<Nullable>enable</Nullable>
@@ -20,7 +20,7 @@
2020
</PropertyGroup>
2121

2222
<ItemGroup>
23-
<PackageReference Include="JetBrains.Annotations" Version="2022.1.0" PrivateAssets="All" />
23+
<PackageReference Include="JetBrains.Annotations" Version="2022.3.1" PrivateAssets="All" />
2424
<PackageReference Include="CSharpGuidelinesAnalyzer" Version="3.8.2" PrivateAssets="All" />
2525
<AdditionalFiles Include="$(MSBuildThisFileDirectory)CSharpGuidelinesAnalyzer.config" Visible="False" />
2626
</ItemGroup>
@@ -37,8 +37,8 @@
3737

3838
<!-- Test Project Dependencies -->
3939
<PropertyGroup>
40-
<CoverletVersion>3.1.2</CoverletVersion>
40+
<CoverletVersion>3.2.0</CoverletVersion>
4141
<MoqVersion>4.18.2</MoqVersion>
42-
<TestSdkVersion>17.3.1</TestSdkVersion>
42+
<TestSdkVersion>17.4.0</TestSdkVersion>
4343
</PropertyGroup>
4444
</Project>

0 commit comments

Comments
 (0)