-
-
Notifications
You must be signed in to change notification settings - Fork 159
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
Support NRT and MSV in required
and nullable
#1185
Conversation
a75fc23
to
916c753
Compare
required
916c753
to
c55a2cb
Compare
Codecov Report
@@ Coverage Diff @@
## openapi #1185 +/- ##
===========================================
+ Coverage 92.65% 92.72% +0.06%
===========================================
Files 329 329
Lines 9863 9941 +78
===========================================
+ Hits 9139 9218 +79
+ Misses 724 723 -1
|
required
required
and nullable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice job! The implementation is straightforward and it's easy to verify the tests against what's in https://user-images.githubusercontent.com/9339132/177394179-2943249b-f5f1-4a72-adab-1c1d7ae85fc6.png. The code looks clean with good naming and structure.
The used models remind me of the Cow and Chicken series that my younger brother always watched! :)
src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceFieldObjectSchemaBuilder.cs
Outdated
Show resolved
Hide resolved
test/OpenApiTests/SchemaProperties/ModelStateValidationDisabledStartup.cs
Outdated
Show resolved
Hide resolved
...ApiTests/SchemaProperties/NullableReferenceTypesDisabled/ModelStateValidationEnabledTests.cs
Outdated
Show resolved
Hide resolved
...ApiTests/SchemaProperties/NullableReferenceTypesDisabled/ModelStateValidationEnabledTests.cs
Outdated
Show resolved
Hide resolved
...ApiTests/SchemaProperties/NullableReferenceTypesDisabled/ModelStateValidationEnabledTests.cs
Outdated
Show resolved
Hide resolved
test/OpenApiClientTests/SchemaProperties/NullableReferenceTypesEnabled/NullabilityTests.cs
Outdated
Show resolved
Hide resolved
test/OpenApiClientTests/SchemaProperties/NullableReferenceTypesDisabled/NullabilityTests.cs
Outdated
Show resolved
Hide resolved
...penApiClientTests/SchemaProperties/NullableReferenceTypesDisabled/RequiredAttributesTests.cs
Outdated
Show resolved
Hide resolved
src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceFieldObjectSchemaBuilder.cs
Show resolved
Hide resolved
...penApiClientTests/SchemaProperties/NullableReferenceTypesDisabled/RequiredAttributesTests.cs
Outdated
Show resolved
Hide resolved
…nd-nullable-properties
This comment was marked as resolved.
This comment was marked as resolved.
Merge openapi branch into PR 1185: Support NRT and MSV in required and nullable
OpenApiTests/SchemaProperties test collection: * Allow for usage of OpenApiStartup directly * Remove unneeded adding of JsonConverter * Replace null checks with .ShouldHaveCount() calls * Adjust test names Misc: * Reverted .editorconfig changes and fixed ApiException constructor instead * Remove Debug statement
The review items I've reacted to are processed in my latest commit. The other ones are related to something I'm still investigating and will follow |
d462a9d
to
589ad48
Compare
This comment was marked as resolved.
This comment was marked as resolved.
OpenAPI NRT/MSV updates
…inesAnalyzer v3.8.4
This PR introduces improved support for
required
andnullable
properties in OpenAPI schemas, by taking into account enabled/disabled nullable reference types and enabled/disabled model state validation. The table in Google Sheets (copy below) supersedes the original table from #1111.Includes:
NullabilityInfoContext
to check nullability information rather than relying on Swashbuckles work-around (supersedes Use native NullabilityInfoContext #1167).OpenApiTestContext
to allow for retrieving a swagger file without having to write it to disk.Closes #1111
Closes #1242
QUALITY CHECKLIST