code: func (c *Client) SwaggerSchema(version unversioned.GroupVersion) (*swagger.ApiDeclaration, error) {
  	if version.IsEmpty() {
  		return nil, fmt.Errorf("groupVersion cannot be empty")
  	}
  
  	groupList, err := c.Discovery().ServerGroups()
  	if err != nil {
  		return nil, err
  	}
  	groupVersions := ExtractGroupVersions(groupList)
  	// This check also takes care the case that kubectl is newer than the running endpoint
  	if stringDoesntExistIn(version.String(), groupVersions) {
  		return nil, fmt.Errorf("API version: %v is not supported by the server. Use one of: %v", version, groupVersions)
  	}
  	var path string
  	if version == v1.SchemeGroupVersion {
  		path = "/swaggerapi/api/" + version.Version
  	} else {
  		path = "/swaggerapi/apis/" + version.Group + "/" + version.Version
  	}
  
  	body, err := c.Get().AbsPath(path).Do().Raw()
  	if err != nil {
  		return nil, err
  	}
  	var schema swagger.ApiDeclaration
  	err = json.Unmarshal(body, &schema)
  	if err != nil {
  		return nil, fmt.Errorf("got '%s': %v", string(body), err)
  	}
  	return &schema, nil
  }
docs: // SwaggerSchema retrieves and parses the swagger API schema the server supports.