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

Add test to expose issue 1572 - spaces in path to doc using relative server #1893

Merged
merged 3 commits into from
Mar 15, 2023

Conversation

ind1go
Copy link
Contributor

@ind1go ind1go commented Mar 14, 2023

#1572 shows that when a document is read from a location with spaces (or other URI-invalid characters) and has a relative server path, an error parsing the document occurs.

This PR starts by exposing the issue through a new test.

It then adds a check that both { and } occur in the server URL before attempting to replace variables in it, which avoids the IndexOutOfBoundsException in the case where no, there's no variable.

@ind1go
Copy link
Contributor Author

ind1go commented Mar 14, 2023

✅ Test failure as expected.

@ind1go ind1go force-pushed the bug/1572-spaces-in-doc-path branch from c0518a0 to 884b47a Compare March 15, 2023 09:43
@ind1go
Copy link
Contributor Author

ind1go commented Mar 15, 2023

✅ Fix added to check that the server URL has both { and } in the case where the document path is not a valid URI.

@gracekarina gracekarina self-assigned this Mar 15, 2023
Copy link
Contributor

@gracekarina gracekarina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

@gracekarina gracekarina merged commit cc337d1 into swagger-api:master Mar 15, 2023
@ind1go ind1go deleted the bug/1572-spaces-in-doc-path branch March 15, 2023 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants