forked from loafle/openapi-generator-original
Fix port when the URL doesn't have port specified (#8049)
* fix port missingin oas 3 spec * update samples
This commit is contained in:
+1
-1
@@ -769,7 +769,7 @@ public class DefaultGenerator implements Generator {
|
||||
bundle.put("basePathWithoutHost", basePathWithoutHost);
|
||||
bundle.put("scheme", URLPathUtils.getScheme(url, config));
|
||||
bundle.put("host", url.getHost());
|
||||
if (url.getPort() != 80 && url.getPort() != 443 ) {
|
||||
if (url.getPort() != 80 && url.getPort() != 443 && url.getPort() != -1) {
|
||||
bundle.put("port", url.getPort());
|
||||
}
|
||||
bundle.put("contextPath", contextPath);
|
||||
|
||||
+1
-1
@@ -139,7 +139,7 @@ module Petstore
|
||||
|
||||
def initialize
|
||||
@scheme = 'http'
|
||||
@host = 'petstore.swagger.io:-1'
|
||||
@host = 'petstore.swagger.io'
|
||||
@base_path = '/v2'
|
||||
@server_index = 0
|
||||
@server_operation_index = {}
|
||||
|
||||
Reference in New Issue
Block a user