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

Add server URL without variables to the test spec #7517

Merged
merged 4 commits into from
Sep 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1135,6 +1135,8 @@ servers:
- 'v1'
- 'v2'
default: 'v2'
- url: https://127.0.0.1/no_variable
description: The local server without variables
components:
requestBodies:
UserArray:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1120,6 +1120,8 @@ servers:
- 'v1'
- 'v2'
default: 'v2'
- url: https://127.0.0.1/no_variable
description: The local server without variables
components:
requestBodies:
UserArray:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1142,6 +1142,8 @@ servers:
- 'v1'
- 'v2'
default: 'v2'
- url: https://127.0.0.1/no_varaible
description: The local server without variables
components:
requestBodies:
UserArray:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,12 @@ public Configuration()
}
}
}
},
{
new Dictionary<string, object> {
{"url", "https://127.0.0.1/no_variable"},
{"description", "The local server without variables"},
}
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,12 @@ public Configuration()
}
}
}
},
{
new Dictionary<string, object> {
{"url", "https://127.0.0.1/no_variable"},
{"description", "The local server without variables"},
}
}
};

Expand Down
4 changes: 4 additions & 0 deletions samples/client/petstore/javascript-es6/src/ApiClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,10 @@ class ApiClient {
]
}
}
},
{
'url': "https://127.0.0.1/no_varaible",
'description': "The local server without variables",
}
];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,10 @@ class ApiClient {
]
}
}
},
{
'url': "https://127.0.0.1/no_varaible",
'description': "The local server without variables",
}
];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,10 @@ public function getHostSettings()
]
]
]
],
[
"url" => "https://127.0.0.1/no_varaible",
"description" => "The local server without variables",
]
];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public function testMultipleServers()
$config = new Configuration();
$servers = $config->getHostSettings();

$this->assertCount(2, $servers);
$this->assertCount(3, $servers);
$this->assertSame("http://{server}.swagger.io:{port}/v2", $servers[0]["url"]);
$this->assertSame("petstore", $servers[0]["variables"]["server"]["default_value"]);
$this->assertSame("80", $servers[0]["variables"]["port"]["default_value"]);
Expand Down Expand Up @@ -47,13 +47,13 @@ public function testServerUrl()
public function testInvalidIndex()
{
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Invalid index 2 when selecting the host. Must be less than 2');
$this->expectExceptionMessage('Invalid index 3 when selecting the host. Must be less than 3');
$config = new Configuration();
$url = $config->getHostFromSettings(2);
$url = $config->getHostFromSettings(3);
}

/**
* Test host settings with invalid vaues
* Test host settings with invalid values
*/
public function testHostUrlWithInvalidValues()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,10 @@ def server_settings
]
}
}
},
{
url: "https://127.0.0.1/no_varaible",
description: "The local server without variables",
}
]
end
Expand Down
4 changes: 4 additions & 0 deletions samples/client/petstore/ruby/lib/petstore/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,10 @@ def server_settings
]
}
}
},
{
url: "https://127.0.0.1/no_varaible",
description: "The local server without variables",
}
]
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ servers:
enum:
- v1
- v2
- description: The local server without variables
url: https://127.0.0.1/no_variable
tags:
- description: Everything about your Pets
name: pet
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ servers:
enum:
- v1
- v2
- description: The local server without variables
url: https://127.0.0.1/no_variable
tags:
- description: Everything about your Pets
name: pet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ public class ApiClient extends JavaTimeFormatter {
)
));
}}
),
new ServerConfiguration(
"https://127.0.0.1/no_variable",
"The local server without variables",
new HashMap<String, ServerVariable>()
)
));
protected Integer serverIndex = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,10 @@ def get_host_settings(self):
]
}
}
},
{
'url': "https://127.0.0.1/no_varaible",
'description': "The local server without variables",
}
]

Expand Down