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

path-level exclusion #184

Merged
merged 4 commits into from
Mar 8, 2024
Merged

path-level exclusion #184

merged 4 commits into from
Mar 8, 2024

Conversation

exoego
Copy link
Owner

@exoego exoego commented Mar 8, 2024

In a complex test case to call several APIs, one may sometimes need to call a private API.
Currently, we can only exclude the entire spec via openapi: false argument.
So, such private APIs are exposed to the OpenAPI schema.

This PR adds ignored_paths option to exclude paths globally.

RSpec::OpenAPI.ignored_paths = ["/admin/full/path/", Regexp.new("^/_internal/")]

@exoego exoego added the enhancement New feature or request label Mar 8, 2024
@exoego exoego marked this pull request as ready for review March 8, 2024 00:23
spec/integration_tests/rails_test.rb Fixed Show fixed Hide fixed
spec/integration_tests/roda_test.rb Fixed Show fixed Hide fixed
spec/requests/rails_spec.rb Fixed Show fixed Hide fixed
spec/requests/roda_spec.rb Fixed Show fixed Hide fixed
Copy link

codecov bot commented Mar 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.01%. Comparing base (f8fede2) to head (8a71b06).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #184      +/-   ##
==========================================
+ Coverage   97.00%   97.01%   +0.01%     
==========================================
  Files          14       14              
  Lines         500      502       +2     
  Branches      115      116       +1     
==========================================
+ Hits          485      487       +2     
  Misses         15       15              

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

@exoego exoego merged commit 4ad8ff8 into master Mar 8, 2024
15 checks passed
@exoego exoego deleted the path-level-exclusion branch March 8, 2024 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant