Skip to content

Basic OpenAPI tests for all JSON:API endpoints #1512

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

Merged
merged 15 commits into from
Mar 22, 2024
Merged

Conversation

bkoelman
Copy link
Member

@bkoelman bkoelman commented Mar 22, 2024

This PR adds basic OpenAPI tests for all JSON:API endpoints, both for NSwag and Kiota.

Additionally, this PR fixes several OpenAPI bugs (links, error status codes) and adds missing tests. See the individual commits for details.

Closes #1243.

QUALITY CHECKLIST

@bkoelman bkoelman changed the base branch from master to openapi March 22, 2024 02:18
@bkoelman bkoelman force-pushed the openapi-endpoint-tests branch from 770a429 to 8f36981 Compare March 22, 2024 03:36
Copy link

codecov bot commented Mar 22, 2024

Codecov Report

Attention: Patch coverage is 78.84615% with 11 lines in your changes are missing coverage. Please review.

Project coverage is 90.77%. Comparing base (2724d63) to head (8556a30).

Files Patch % Lines
.../JsonApiDotNetCore.OpenApi/ParameterInfoWrapper.cs 61.53% 10 Missing ⚠️
...enApi/JsonApiActionDescriptorCollectionProvider.cs 85.71% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           openapi    #1512      +/-   ##
===========================================
- Coverage    90.80%   90.77%   -0.03%     
===========================================
  Files          394      394              
  Lines        12975    12992      +17     
  Branches      2057     2057              
===========================================
+ Hits         11782    11794      +12     
- Misses         777      782       +5     
  Partials       416      416              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

bkoelman added 11 commits March 22, 2024 04:43
…he same ID already exists on post resource request
Turns out these were not redundant, after all. They are needed as entry points for request body parameters. A default schema is being generated without them, so not running our own generator. The effect is that 'data' in nullable relationships is not marked as `nullable: true`.

This reverts commit b0fa688.
Reverting the effects of this Resharper rule because it makes stack traces harder to understand, while the gain it provides is theoretical.
Resharper turned off this suggestion in the default ruleset in a later version.

This reverts commit 9919ccc.
@bkoelman bkoelman force-pushed the openapi-endpoint-tests branch from 8f36981 to 8556a30 Compare March 22, 2024 03:43
@bkoelman bkoelman marked this pull request as ready for review March 22, 2024 05:33
@bkoelman bkoelman merged commit c67b602 into openapi Mar 22, 2024
16 checks passed
@bkoelman bkoelman deleted the openapi-endpoint-tests branch March 22, 2024 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Add OpenApiEndToEndTests
1 participant