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: normalize documentUri #1185

Merged
merged 2 commits into from May 28, 2020
Merged

fix: normalize documentUri #1185

merged 2 commits into from May 28, 2020

Conversation

P0lip
Copy link
Contributor

@P0lip P0lip commented May 27, 2020

3 tests seem to fail regularly on CI (Windows).
I thought they were flaky, yet it turns out we have a minor issue here.
Minor, cause it may only happen when Spectral is used programmatically and a plain string is passed to run & $ref resolving takes place.

Checklist

  • Tests added / updated
  • Docs added / updated

Does this PR introduce a breaking change?

  • Yes
  • No

@P0lip P0lip added the t/bug Something isn't working label May 27, 2020
@P0lip P0lip added this to the 2020-05-27 milestone May 27, 2020
@P0lip P0lip self-assigned this May 27, 2020
@P0lip P0lip marked this pull request as ready for review May 27, 2020 21:13
@P0lip P0lip requested a review from nulltoken May 27, 2020 21:13
@nulltoken
Copy link
Contributor

3 tests seem to fail regularly on CI (Windows).
I thought they were flaky, yet it turns out we have a minor issue here.
Minor, cause it may only happen when Spectral is used programmatically and a plain string is passed to run & $ref resolving takes place.

@P0lip Thanks! However, I'm a bit lost here. How come this was only happening on Windows?

@P0lip
Copy link
Contributor Author

P0lip commented May 28, 2020

How come this was only happening on Windows?

We didn't normalize the document source, so deduping by fingerprint was failing due to path differences (slashes).

@P0lip
Copy link
Contributor Author

P0lip commented May 28, 2020

Based on that, I decided to slightly tweak the code so the actual change is more clear, as indeed it wasn't obvious at first glance.

@P0lip P0lip changed the title fix: pass documentUri fix: normalize documentUri May 28, 2020
Copy link
Contributor

@nulltoken nulltoken left a comment

Choose a reason for hiding this comment

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

Love it!

@P0lip P0lip merged commit 7136b90 into develop May 28, 2020
@P0lip P0lip deleted the fix/pass-document-uri branch May 28, 2020 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t/bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants