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

OpenApi: Fix params mapping on relative URL #520

Merged
merged 2 commits into from
Jan 8, 2022

Conversation

fatal10110
Copy link
Contributor

@fatal10110 fatal10110 commented Dec 27, 2021

Fix for a bug, when stripBasePath is disabled and openApi is configured. it will not map path params to fastify params.

Checklist

@coveralls
Copy link

Pull Request Test Coverage Report for Build 1628361882

  • 0 of 2 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 1591025986: 0.0%
Covered Lines: 629
Relevant Lines: 629

💛 - Coveralls

@coveralls
Copy link

coveralls commented Dec 27, 2021

Pull Request Test Coverage Report for Build 1628361882

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 2 of 2 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 1591025986: 0.0%
Covered Lines: 629
Relevant Lines: 629

💛 - Coveralls

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

I think the code should be linted.

test/spec/openapi/route.js Outdated Show resolved Hide resolved
examples/options.js Outdated Show resolved Hide resolved
@fatal10110
Copy link
Contributor Author

I think the code should be linted.

Not sure what do you mean by "linted", I used npm run test which is also triggering the "standard" cli, also the CI checks passed

@@ -67,7 +67,7 @@ function prepareOpenapiObject (opts) {
}

function normalizeUrl (url, servers, stripBasePath) {
if (!stripBasePath) return url
if (!stripBasePath) return formatParamUrl(url)
Copy link
Member

Choose a reason for hiding this comment

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

Good catch

@mcollina
Copy link
Member

Not sure what do you mean by "linted", I used npm run test which is also triggering the "standard" cli, also the CI checks passed

nevermind, things were scrambled on mobile.

@Eomm Eomm requested a review from climba03003 January 8, 2022 20:13
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

5 participants