Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge openapi branch into PR 1185: Support NRT and MSV in required and nullable #1229

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
6b69ed3
Fixed error in documentation example
bkoelman Sep 9, 2022
79d918a
Update links to JSON:API v1.1-final
bkoelman Oct 1, 2022
1dc249b
Improve error message when duplicate controllers are found, to includ…
bkoelman Sep 28, 2022
70c06b9
Multi-target Annotations against .NET Standard 1.0
bkoelman Sep 28, 2022
ba0278b
Update to latest Resharper version (disabled in Ubuntu cibuild)
bkoelman Sep 23, 2022
4c61b49
Revert workaround for bug that was fixed in recent Resharper version
bkoelman Sep 24, 2022
add5bda
Reduce the severity of 'Introduce optional parameters' for non-privat…
bkoelman Sep 23, 2022
3a1e039
Reduce the use of nameof() in parameter validations by using CallerAr…
bkoelman Sep 23, 2022
a5217e6
Remove end_of_line from .editorconfig to avoid dialog in Visual Studi…
bkoelman Sep 24, 2022
4b68308
Update .editorconfig to better align with Resharper settings
bkoelman Sep 24, 2022
2aae844
Include ruleset in solution, so it gets reformatted
bkoelman Sep 24, 2022
8008e5e
Refresh .gitignore from source, preserving our additions
bkoelman Sep 28, 2022
292fb45
Add Rider-specific formatter settings
bkoelman Sep 28, 2022
2e2c123
Merge pull request #1191 from json-api-dotnet/update-resharper-skip-l…
maurei Oct 3, 2022
ea3ab72
Merge pull request #1192 from json-api-dotnet/multi-target-annotations
bkoelman Oct 3, 2022
6c11bae
Add missing CDATA sections to code fragments
bkoelman Sep 30, 2022
78b1f51
Add capabilities for relationships
bkoelman Oct 1, 2022
45b1136
Allow empty include query string parameter value
bkoelman Oct 1, 2022
f2c6029
Fixed: full linkage does not allow primary resources to occur in incl…
bkoelman Oct 1, 2022
935224d
Remove unneeded dependencies
bkoelman Oct 3, 2022
8726518
Fix SourceLink and IntelliSense on doc-comments in Annotations
bkoelman Oct 3, 2022
b13ede9
Update compatibility table
bkoelman Oct 7, 2022
cdf3c0b
Update compatibility table (remove v)
bkoelman Oct 7, 2022
da9048f
Merge pull request #1193 from json-api-dotnet/duplicate-controllers-e…
maurei Oct 19, 2022
2113302
Update docs/usage/resources/relationships.md
bkoelman Oct 19, 2022
4b725bd
Fixed typo
bkoelman Oct 19, 2022
01e132b
Correct pattern that is used in null-check refactorings
bkoelman Oct 20, 2022
af46168
Merge pull request #1197 from json-api-dotnet/relationship-capabilities
maurei Oct 20, 2022
375a0ed
Merge pull request #1186 from json-api-dotnet/merge-master-v503-into-…
maurei Oct 20, 2022
993ed61
Updates tests to write SQL statements to the Output Window, so we don…
bkoelman Oct 25, 2022
2e4f15e
Update guidance on one-to-one relationship mapping in EF Core to avoi…
bkoelman Oct 26, 2022
bbec95b
Fix naming inconsistency
bkoelman Oct 26, 2022
75fad29
Updated example to match with current implementation
bkoelman Oct 27, 2022
6acf0cd
Merge pull request #1206 from json-api-dotnet/dump-sql-in-tests
maurei Nov 3, 2022
d6286c3
Merge pull request #1207 from json-api-dotnet/docs-one-to-one-relatio…
maurei Nov 3, 2022
ac285b0
Merge pull request #1208 from json-api-dotnet/docs-queries-example
maurei Nov 3, 2022
13a47d2
Update version to 5.1.0
bkoelman Nov 8, 2022
ceb27c3
Increment version to 5.1.1 (used for pre-release builds from ci)
bkoelman Nov 8, 2022
e39a870
Merge branch 'master' into merge-v5.1-into-openapi
bkoelman Nov 8, 2022
f476ce2
Post-merge fixes
bkoelman Nov 8, 2022
833312d
Run cibuild on Ubuntu 20.04 LTS instead of 18.04.4 LTS
bkoelman Nov 8, 2022
d5735df
Merge pull request #1210 from json-api-dotnet/update-linux-in-cibuild
bkoelman Nov 9, 2022
ac6a210
Merge branch 'master' into merge-v5.1-into-openapi
bkoelman Nov 9, 2022
3d4be05
Use built-in HashSet<>.UnionWith() instead of our own .AddRange()
bkoelman Nov 11, 2022
1ab58db
Merge branch 'master' into merge-v5.1-into-openapi
bkoelman Nov 11, 2022
1fff6cd
Update to PostgreSQL v15
bkoelman Nov 12, 2022
9039dcd
Update for changed nullability annotations in .NET 7
bkoelman Nov 12, 2022
023cdcc
Package updates
bkoelman Nov 12, 2022
c14637c
Merge pull request #1216 from json-api-dotnet/package-updates
bkoelman Nov 12, 2022
d1fb4d0
Turn off constraints for running tests in parallel
bkoelman Nov 12, 2022
bfecdeb
Add throttling on integration tests that are running in parallel
bkoelman Nov 12, 2022
a349fb9
Fixed: temporary database created by test not deleted afterwards
bkoelman Nov 12, 2022
fd16904
Avoid potential database name clashes in tests
bkoelman Nov 12, 2022
7cdf273
Apply global convention for all integration tests: change DeleteBehav…
bkoelman Nov 12, 2022
c7b8601
Start PostgreSQL service explicitly on Windows
bkoelman Nov 14, 2022
109d098
Update to latest version of regitlint and switch to full cleanup when…
bkoelman Nov 16, 2022
aecf4c7
Merge pull request #1215 from json-api-dotnet/postgres-update
maurei Nov 26, 2022
afa80e8
Merge pull request #1218 from json-api-dotnet/xunit-perf-throttling
maurei Nov 26, 2022
008bc00
Merge pull request #1219 from json-api-dotnet/update-regitlint
maurei Nov 26, 2022
84d01c3
Suppress typo warnings in faker-generated text
bkoelman Dec 8, 2022
ec52cf7
Merge branch 'master' into merge-v5.1-into-openapi
maurei Dec 14, 2022
4392777
Merge pull request #1209 from json-api-dotnet/merge-v5.1-into-openapi
maurei Dec 14, 2022
0e74591
Remove xunit config file and call base OnModelCreating in OpenApiTest…
maurei Dec 15, 2022
7288b8a
Merge branch 'openapi' into openapi-required-and-nullable-properties
bkoelman Dec 15, 2022
d7c8b4b
Post-merge fixes
bkoelman Dec 15, 2022
d72e43e
Fixed: do not share NullabilityInfoContext, it is not thread-safe
bkoelman Dec 15, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"isRoot": true,
"tools": {
"jetbrains.resharper.globaltools": {
"version": "2021.3.4",
"version": "2022.2.4",
"commands": [
"jb"
]
},
"regitlint": {
"version": "6.1.1",
"version": "6.2.1",
"commands": [
"regitlint"
]
Expand All @@ -21,7 +21,7 @@
]
},
"dotnet-reportgenerator-globaltool": {
"version": "5.1.3",
"version": "5.1.11",
"commands": [
"reportgenerator"
]
Expand Down
62 changes: 33 additions & 29 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,24 @@ indent_style = space
indent_size = 4
charset = utf-8
trim_trailing_whitespace = true
end_of_line = lf
insert_final_newline = true

[*.{csproj,json}]
[*.{config,csproj,css,js,json,props,ruleset,xslt}]
indent_size = 2

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

[*.{cs}]
#### .NET Coding Conventions ####
#### C#/.NET Coding Conventions ####

# Organize usings
# 'using' directive preferences
dotnet_sort_system_directives_first = true
csharp_using_directive_placement = outside_namespace:suggestion

# Namespace declarations
csharp_style_namespace_declarations = file_scoped:suggestion

# this. preferences
dotnet_style_qualification_for_field = false:suggestion
Expand All @@ -34,13 +37,15 @@ dotnet_style_predefined_type_for_member_access = true:suggestion

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

# Expression-level preferences
dotnet_style_operator_placement_when_wrapping = end_of_line
dotnet_style_prefer_auto_properties = true:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion
dotnet_style_prefer_conditional_expression_over_return = true:suggestion
csharp_style_unused_value_expression_statement_preference = discard_variable:suggestion

# Parameter preferences
dotnet_code_quality_unused_parameters = non_public:suggestion
Expand All @@ -58,38 +63,38 @@ csharp_style_expression_bodied_properties = true:suggestion
# Code-block preferences
csharp_prefer_braces = true:suggestion

# Expression-level preferences
csharp_style_unused_value_expression_statement_preference = discard_variable:suggestion

# 'using' directive preferences
csharp_using_directive_placement = outside_namespace:suggestion


#### C# Formatting Rules ####

# Indentation preferences
csharp_indent_case_contents_when_block = false

# Wrapping preferences
csharp_preserve_single_line_statements = false

# 'var' usage preferences
csharp_style_var_for_built_in_types = false:suggestion
csharp_style_var_when_type_is_apparent = true:suggestion
csharp_style_var_elsewhere = false:suggestion

# Parentheses preferences
dotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary:suggestion
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:suggestion
dotnet_style_parentheses_in_relational_binary_operators = never_if_unnecessary:suggestion

#### Naming styles ####
#### Naming Style ####

dotnet_diagnostic.IDE1006.severity = warning

# Naming rules
dotnet_naming_rule.private_const_fields_should_be_pascal_case.symbols = private_const_fields
dotnet_naming_rule.private_const_fields_should_be_pascal_case.style = pascal_case
dotnet_naming_rule.private_const_fields_should_be_pascal_case.severity = warning
dotnet_naming_rule.const_fields_should_be_pascal_case.symbols = const_fields
dotnet_naming_rule.const_fields_should_be_pascal_case.style = pascal_case
dotnet_naming_rule.const_fields_should_be_pascal_case.severity = warning

dotnet_naming_rule.private_static_readonly_fields_should_be_pascal_case.symbols = private_static_readonly_fields
dotnet_naming_rule.private_static_readonly_fields_should_be_pascal_case.style = pascal_case
dotnet_naming_rule.private_static_readonly_fields_should_be_pascal_case.severity = warning

dotnet_naming_rule.private_static_or_readonly_fields_should_start_with_underscore.symbols = private_static_or_readonly_fields
dotnet_naming_rule.private_static_or_readonly_fields_should_start_with_underscore.style = camel_case_prefix_with_underscore
dotnet_naming_rule.private_static_or_readonly_fields_should_start_with_underscore.severity = warning
dotnet_naming_rule.private_fields_should_start_with_underscore.symbols = private_fields
dotnet_naming_rule.private_fields_should_start_with_underscore.style = camel_case_prefix_with_underscore
dotnet_naming_rule.private_fields_should_start_with_underscore.severity = warning

dotnet_naming_rule.locals_and_parameters_should_be_camel_case.symbols = locals_and_parameters
dotnet_naming_rule.locals_and_parameters_should_be_camel_case.style = camel_case
Expand All @@ -100,25 +105,24 @@ dotnet_naming_rule.types_and_members_should_be_pascal_case.style = pascal_case
dotnet_naming_rule.types_and_members_should_be_pascal_case.severity = warning

# Symbol specifications
dotnet_naming_symbols.private_const_fields.applicable_kinds = field
dotnet_naming_symbols.private_const_fields.applicable_accessibilities = private
dotnet_naming_symbols.private_const_fields.required_modifiers = const
dotnet_naming_symbols.const_fields.applicable_kinds = field
dotnet_naming_symbols.const_fields.applicable_accessibilities = *
dotnet_naming_symbols.const_fields.required_modifiers = const

dotnet_naming_symbols.private_static_readonly_fields.applicable_kinds = field
dotnet_naming_symbols.private_static_readonly_fields.applicable_accessibilities = private
dotnet_naming_symbols.private_static_readonly_fields.required_modifiers = static,readonly
dotnet_naming_symbols.private_static_readonly_fields.required_modifiers = static, readonly

dotnet_naming_symbols.private_static_or_readonly_fields.applicable_kinds = field
dotnet_naming_symbols.private_static_or_readonly_fields.applicable_accessibilities = private
dotnet_naming_symbols.private_static_or_readonly_fields.required_modifiers = static readonly
dotnet_naming_symbols.private_fields.applicable_kinds = field
dotnet_naming_symbols.private_fields.applicable_accessibilities = private

dotnet_naming_symbols.locals_and_parameters.applicable_kinds = local,parameter
dotnet_naming_symbols.locals_and_parameters.applicable_kinds = local, parameter
dotnet_naming_symbols.locals_and_parameters.applicable_accessibilities = *

dotnet_naming_symbols.types_and_members.applicable_kinds = *
dotnet_naming_symbols.types_and_members.applicable_accessibilities = *

# Naming styles
# Style specifications
dotnet_naming_style.pascal_case.capitalization = pascal_case

dotnet_naming_style.camel_case_prefix_with_underscore.required_prefix = _
Expand Down
72 changes: 64 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore

# User-specific files
*.rsuser
Expand Down Expand Up @@ -90,16 +90,14 @@ StyleCopReport.xml
*.tmp_proj
*_wpftmp.csproj
*.log
*.tlog
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc

# MacOS file systems
**/.DS_STORE

# Chutzpah Test files
_Chutzpah*

Expand Down Expand Up @@ -134,9 +132,6 @@ _ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user

# JetBrains Rider
.idea/

# TeamCity is a build add-in
_TeamCity*

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

# Coverlet is a free, cross platform Code Coverage Tool
coverage*[.json, .xml, .info]
coverage*.json
coverage*.xml
coverage*.info

# Visual Studio code coverage results
*.coverage
Expand Down Expand Up @@ -297,6 +294,17 @@ node_modules/
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw

# Visual Studio 6 auto-generated project file (contains which files were open etc.)
*.vbp

# Visual Studio 6 workspace and project file (working project files containing files to include in project)
*.dsw
*.dsp

# Visual Studio 6 technical files
*.ncb
*.aps

# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
Expand Down Expand Up @@ -353,6 +361,9 @@ ASALocalRun/
# Local History for Visual Studio
.localhistory/

# Visual Studio History (VSHistory) files
.vshistory/

# BeatPulse healthcheck temp database
healthchecksdb

Expand All @@ -365,5 +376,50 @@ MigrationBackup/
# Fody - auto-generated XML schema
FodyWeavers.xsd

# VS Code files for those working on multiple tools
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace

# Local History for Visual Studio Code
.history/

# Windows Installer files from build outputs
*.cab
*.msi
*.msix
*.msm
*.msp

# JetBrains Rider
*.sln.iml

#############################################
### Additions specific to this repository ###
#############################################

# MacOS file systems
**/.DS_STORE

# Sqlite example databases
*.db

# JetBrains IDEs Rider/IntelliJ (based on https://intellij-support.jetbrains.com/hc/en-us/articles/206544839)
**/.idea/**/*.xml
**/.idea/**/*.iml
**/.idea/**/*.ids
**/.idea/**/*.ipr
**/.idea/**/*.iws
**/.idea/**/*.name
**/.idea/**/*.properties
**/.idea/**/*.ser
**/.idea/**/shelf/
**/.idea/**/dictionaries/
**/.idea/**/libraries/
**/.idea/**/artifacts/
**/.idea/**/httpRequests/
**/.idea/**/dataSources/
!**/.idea/**/codeStyles/*
1 change: 1 addition & 0 deletions .idea/.idea.JsonApiDotNetCore/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions .idea/.idea.JsonApiDotNetCore/.idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ function CheckLastExitCode {

function RunInspectCode {
$outputPath = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), 'jetbrains-inspectcode-results.xml')
# passing --build instead of --no-build as workaround for https://youtrack.jetbrains.com/issue/RSRP-487054
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
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
CheckLastExitCode

[xml]$xml = Get-Content "$outputPath"
Expand Down Expand Up @@ -52,7 +51,7 @@ function RunCleanupCode {

if ($baseCommitHash -ne $headCommitHash) {
Write-Output "Running code cleanup on commit range $baseCommitHash..$headCommitHash in pull request."
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
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
CheckLastExitCode
}
}
Expand Down Expand Up @@ -114,8 +113,11 @@ CheckLastExitCode
dotnet build -c Release
CheckLastExitCode

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

dotnet test -c Release --no-build --collect:"XPlat Code Coverage"
CheckLastExitCode
Expand Down
8 changes: 4 additions & 4 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<NSwagApiClientVersion>13.16.*</NSwagApiClientVersion>
<MicrosoftApiClientVersion>6.0.*</MicrosoftApiClientVersion>
<NewtonsoftJsonVersion>13.0.*</NewtonsoftJsonVersion>
<JsonApiDotNetCoreVersionPrefix>5.0.4</JsonApiDotNetCoreVersionPrefix>
<JsonApiDotNetCoreVersionPrefix>5.1.1</JsonApiDotNetCoreVersionPrefix>
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)CodingGuidelines.ruleset</CodeAnalysisRuleSet>
<WarningLevel>9999</WarningLevel>
<Nullable>enable</Nullable>
Expand All @@ -20,7 +20,7 @@
</PropertyGroup>

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

<!-- Test Project Dependencies -->
<PropertyGroup>
<CoverletVersion>3.1.2</CoverletVersion>
<CoverletVersion>3.2.0</CoverletVersion>
<MoqVersion>4.18.2</MoqVersion>
<TestSdkVersion>17.3.1</TestSdkVersion>
<TestSdkVersion>17.4.0</TestSdkVersion>
</PropertyGroup>
</Project>
Loading