-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Client requests use incomplete URL resulting in failure #3
Comments
After stepping through the auto generated code I believe I have a better understanding of what's happening and a straight forward work-around. The Kratos OpenAPI spec does not contain any Server Objects. The client generated data To do so implementers need to change the Existing code examplehttps://github.com/ory/kratos-client-ruby/blob/master/docs/V0alpha2Api.md#examples-12 require 'time'
require 'ory-kratos-client'
api_instance = OryKratosClient::V0alpha2Api.new
id = 'id_example' # String | The Registration Flow ID The value for this parameter comes from `flow` URL Query parameter sent to your application (e.g. `/registration?flow=abcde`).
opts = {
cookie: 'cookie_example' # String | HTTP Cookies When using the SDK on the server side you must include the HTTP Cookie Header originally sent to your HTTP handler here.
}
begin
# Get Registration Flow
result = api_instance.get_self_service_registration_flow(id, opts)
p result
rescue OryKratosClient::ApiError => e
puts "Error when calling V0alpha2Api->get_self_service_registration_flow: #{e}"
end
}
begin
# Get Registration Flow
result = api_instance.get_self_service_registration_flow(id, opts)
p result
rescue OryKratosClient::ApiError => e
puts "Error when calling V0alpha2Api->get_self_service_registration_flow: #{e}"
end Code example with work-around# Modifies the kratos client configuration 'server_index' to ensure the URL building function doesn't
# look for non-existant OpenAPI server objects.
require 'time'
require 'ory-kratos-client'
OryKratosClient.configure do |config|
config.server_index = nil
end
api_instance = OryKratosClient::V0alpha2Api.new
... Thoughts on Kratos OpenAPI spec fixAnother possible solution may be to specify a Server Object in the Kratos OpenAPI spec? My example sets the hostname to the default used in the client config. {
"servers": [
{
"url": "http://localhost",
"description": "Development server"
}
]
} Thoughts on OpenAPI Ruby client generator fix
|
Thank you for investigating! Openapi released version 5.3.0, maybe it's fixed there already? |
Bump, does not seem to be fixed, still getting the error unless I use a workaround |
Hmm, maybe we can just add this somewhere in our Documentation until a fix is issued? |
@znorris Thanks so much for documenting this, it saved me a lot of time. |
@tomekpapiernik @vinckr please check this |
We have since upgraded to SDK generator version 6 - can you please check if this is still a problem? |
Preflight checklist
Describe the bug
Ruby SDK does not properly generate a request URL, leaving out scheme and hostname. The http client library, Typhoeus, is unable to attempt the request because of this.
Reproducing the bug
Make a registration flow request using the SDK as documented. See relevant log output. Note the
effective_url
should include a scheme and hostname as well. The answer is somewhere near this URL builder in the generated code.Relevant log output
Relevant configuration
No response
Version
0.8.0.alpha2
On which operating system are you observing this issue?
macOS
In which environment are you deploying?
Docker Compose
Additional Context
I've also tested version
0.7.6.alpha7
The text was updated successfully, but these errors were encountered: