func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) {
	return c.Servers.URL(index, variables)
}
ServerURL returns URL based on server settings
package openapi
import (
	"context"
	"fmt"
	"net/http"
	"strings"
)
type contextKey string
func (c contextKey) String() string {
	return "auth " + string(c)
}
var (
	ContextOAuth2 = contextKey("token")
	ContextBasicAuth = contextKey("basic")
	ContextAccessToken = contextKey("accesstoken")
	ContextAPIKeys = contextKey("apiKeys")
	ContextHttpSignatureAuth = contextKey("httpsignature")
	ContextServerIndex = contextKey("serverIndex")
	ContextOperationServerIndices = contextKey("serverOperationIndices")
	ContextServerVariables = contextKey("serverVariables")
	ContextOperationServerVariables = contextKey("serverOperationVariables")
)
type BasicAuth struct {
	UserName string `json:"userName,omitempty"`
	Password string `json:"password,omitempty"`
}
type APIKey struct {
	Key    string
	Prefix string
}
type ServerVariable struct {
	Description  string
	DefaultValue string
	EnumValues   []string
}
type ServerConfiguration struct {
	URL         string
	Description string
	Variables   map[string]ServerVariable
}
type ServerConfigurations []ServerConfiguration
type Configuration struct {
	Host             string            `json:"host,omitempty"`
	Scheme           string            `json:"scheme,omitempty"`
	DefaultHeader    map[string]string `json:"defaultHeader,omitempty"`
	UserAgent        string            `json:"userAgent,omitempty"`
	Debug            bool              `json:"debug,omitempty"`
	Servers          ServerConfigurations
	OperationServers map[string]ServerConfigurations
	HTTPClient       *http.Client
}
func NewConfiguration() *Configuration {
	cfg := &Configuration{
		DefaultHeader: make(map[string]string),
		UserAgent:     "OpenAPI-Generator/1.0.0/go",
		Debug:         false,
		Servers: ServerConfigurations{
			{
				URL:         "/api/v1",
				Description: "No description provided",
			},
		},
		OperationServers: map[string]ServerConfigurations{},
	}
	return cfg
}
func (c *Configuration) AddDefaultHeader(key string, value string) {
	c.DefaultHeader[key] = value
}
func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) {
	if index < 0 || len(sc) <= index {
		return "", fmt.Errorf("Index %v out of range %v", index, len(sc)-1)
	}
	server := sc[index]
	url := server.URL
	for name, variable := range server.Variables {
		if value, ok := variables[name]; ok {
			found := bool(len(variable.EnumValues) == 0)
			for _, enumValue := range variable.EnumValues {
				if value == enumValue {
					found = true
				}
			}
			if !found {
				return "", fmt.Errorf("The variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues)
			}
			url = strings.Replace(url, "{"+name+"}", value, -1)
		} else {
			url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1)
		}
	}
	return url, nil
}