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

Update docs with deails about --no-deprecated-operations #155

Merged
merged 4 commits into from
Sep 12, 2023

Conversation

christianhelle
Copy link
Owner

The changes here also add missing tests regarding handling deprecated operations and skipping code generation of deprecated operations

This commit introduces the DeprecatedEndpointTests.cs file which includes unit tests to verify if deprecated OpenAPI endpoints are handled correctly. The tests ensure that the generated code builds successfully, contains an "[System.Obsolete]" attribute and is not empty/null. This is crucial to maintain API stability and to avoid unintended use of deprecated endpoints.
A new test file, DeprecatedEndpointsSkippedTests.cs, has been added. These tests ensure that the refit code generation process correctly skips endpoints marked as deprecated in the OpenAPI specifications. This is to prevent usage of obsolete endpoints, improving the reliability and up-to-dateness of the codebase.
Added information about the `--no-deprecated-operations` option in the README files. This option enables users to choose not to generate deprecated operations. This update provides clearer guidance for users on how to work with deprecated operations when generating code from an OpenAPI specifications file.
A flag has been added to the Github Workflow configuration to ignore deprecated operations on the /pet/ endpoint. This change is done to ensure our workflow only considers up-to-date operations and avoids any issues that can arise from deprecated operations.
@christianhelle christianhelle added the documentation Improvements or additions to documentation label Sep 12, 2023
@christianhelle christianhelle self-assigned this Sep 12, 2023
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@codecov
Copy link

codecov bot commented Sep 12, 2023

Codecov Report

Merging #155 (167530a) into main (970363b) will increase coverage by 0.08%.
Report is 1 commits behind head on main.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #155      +/-   ##
==========================================
+ Coverage   98.32%   98.40%   +0.08%     
==========================================
  Files          37       39       +2     
  Lines        1195     1255      +60     
==========================================
+ Hits         1175     1235      +60     
  Misses          6        6              
  Partials       14       14              
Flag Coverage Δ
unittests 98.40% <100.00%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
...Refitter.Tests/Examples/DeprecatedEndpointTests.cs 100.00% <100.00%> (ø)
....Tests/Examples/DeprecatedEndpointsSkippedTests.cs 100.00% <100.00%> (ø)

@christianhelle christianhelle merged commit 3cb81d1 into main Sep 12, 2023
@christianhelle christianhelle deleted the deprecated-operation-tests branch September 12, 2023 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant