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

Fix path expansion #660

Merged
merged 1 commit into from
Jul 13, 2023
Merged

Fix path expansion #660

merged 1 commit into from
Jul 13, 2023

Conversation

carlobeltrame
Copy link
Contributor

Reverts part of efd4ea4

Problem

The dir_string is ignored if file_name starts with a slash. In our case of retrieving the HTTP request path from env, path will start with a slash. This broke swagger file resolution.

Solution

Revert back to the File.join method which is safer in case of risk of additional slashes.

This concerns this parts of the OpenAPI Specification:

The changes I made are compatible with:

  • OAS2
  • OAS3
  • OAS3.1

Related Issues

#654 (comment)
#653

Checklist

  • Added tests
  • Changelog updated
  • Added documentation to README.md
  • Added example of using the enhancement into test-app

Steps to Test or Reproduce

Outline the steps to test or reproduce the PR here.

Reverts part of efd4ea4
The dir_string is ignored if file_name starts with a slash. In our case of retrieving the HTTP request path from env, path will start with a slash. This broke swagger file resolution.
@romanblanco romanblanco merged commit 5b34ec9 into rswag:master Jul 13, 2023
10 checks passed
@carlobeltrame carlobeltrame deleted the patch-1 branch July 13, 2023 16:06
@sergioisidoro
Copy link
Member

Damn. We should add a regression test, because all tests passed :/

Sorry for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants