Closed johngiffin closed 8 years ago
Yes it should. Will take a look, probably early next week. I expect it's due to our usage of URI
.
Here are my changes to lib/swagger_yard/swagger.rb. I can submit a PR if that would be helpful.
def to_h
host { "swagger" => "2.0", "info" => Info.new.to_h, "host" => host, "basePath" => URI(SwaggerYard.config.api_base_path).request_uri }.merge(ResourceListing.all.to_h) end
private
def host uri = URI(SwaggerYard.config.api_base_path)
if uri.default_port == uri.port uri.host else "#{uri.host}:#{uri.port}" end end
end
The host name returned in swagger json should include the port so that swagger UI can generate the right "curl" and "try it" urls.
The spec indicates that host may include a port: http://swagger.io/specification/