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
Return correct version href #87
Return correct version href #87
Conversation
@@ -26,7 +26,7 @@ def entrypoint_versions | |||
ApiConfig.version.definitions.select(&:ident).collect do |version_specification| | |||
{ | |||
:name => version_specification[:name], | |||
:href => "#{@req.api_prefix}/#{version_specification[:ident]}" | |||
:href => @req.api_prefix.include?(version_specification[:ident]) ? @req.api_prefix : "#{@req.api_prefix}/#{version_specification[:ident]}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you double check the code in parser/request_adapter.rb ? I thought api_prefix always includes the version so we may not want to use it.
issue remaining, I've added 2.4.0 as a version def in the api.yml and got this while fetching GET /api/v2.4.0
"version": "3.0.0-pre",
"versions": [
{
"name": "3.0.0-pre",
"href": "http://localhost:3000/api/v2.4.0/v3.0.0-pre"
},
{
"name": "2.4.0",
"href": "http://localhost:3000/api/v2.4.0"
}
],
Is this still a thing with #88 ? |
yep, have tried this PR with #88, still an issue. |
ping @jntullo can you double check the failures. thanks. |
@abellotti seeing the same failures on other PRs. seems external, trying to figure it out |
This pull request is not mergeable. Please rebase and repush. |
Checked commit jntullo@0ba0e61 with ruby 2.3.1, rubocop 0.47.1, and haml-lint 0.20.0 |
LGTM!! Thanks @jntullo for fixing this. |
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1485424
Currently, when
GET /api/:version
is called, the href that is returned for the version in the response is in the format/api/:version/:version
. This ensures only/api/:version
is returned.@miq-bot add_label bug
@miq-bot assign @abellotti