Adding http:// prefix to the swagger WebServicesURL to prevent basePath validation errors

pull/6/head
nikhiljindal 2015-03-11 16:14:14 -07:00
parent 7d53425bbc
commit 8c3f728aa6
7 changed files with 6806 additions and 6976 deletions

View File

@ -1,7 +1,7 @@
{
"swaggerVersion": "1.2",
"apiVersion": "",
"basePath": "127.0.0.1:6443",
"basePath": "https://127.0.0.1:6443",
"resourcePath": "/api",
"apis": [
{

View File

@ -1,14 +1,6 @@
{
"swaggerVersion": "1.2",
"apis": [
{
"path": "/api",
"description": "get available API versions"
},
{
"path": "/version",
"description": "git code version from which this is built"
},
{
"path": "/api/v1beta1",
"description": "API at /api/v1beta1 version v1beta1"
@ -20,6 +12,14 @@
{
"path": "/api/v1beta3",
"description": "API at /api/v1beta3 version v1beta3"
},
{
"path": "/api",
"description": "get available API versions"
},
{
"path": "/version",
"description": "git code version from which this is built"
}
],
"apiVersion": "",

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
{
"swaggerVersion": "1.2",
"apiVersion": "",
"basePath": "127.0.0.1:6443",
"basePath": "https://127.0.0.1:6443",
"resourcePath": "/version",
"apis": [
{

View File

@ -519,11 +519,18 @@ func (m *Master) init(c *Config) {
// register their own web services into the Kubernetes mux prior to initialization
// of swagger, so that other resource types show up in the documentation.
func (m *Master) InstallSwaggerAPI() {
webServicesUrl := ""
// Use the secure read write port, if available.
if m.publicReadWritePort != 0 {
webServicesUrl = "https://" + net.JoinHostPort(m.publicIP.String(), strconv.Itoa(m.publicReadWritePort))
} else {
// Use the read only port.
webServicesUrl = "http://" + net.JoinHostPort(m.publicIP.String(), strconv.Itoa(m.publicReadOnlyPort))
}
// Enable swagger UI and discovery API
swaggerConfig := swagger.Config{
WebServicesUrl: net.JoinHostPort(m.publicIP.String(), strconv.Itoa(m.publicReadWritePort)),
WebServices: m.handlerContainer.RegisteredWebServices(),
// TODO: Parameterize the path?
WebServicesUrl: webServicesUrl,
WebServices: m.handlerContainer.RegisteredWebServices(),
ApiPath: "/swaggerapi/",
SwaggerPath: "/swaggerui/",
SwaggerFilePath: "/swagger-ui/",