Skip to content

Commit

Permalink
Expose swagger.json (#420)
Browse files Browse the repository at this point in the history
  • Loading branch information
tamalsaha authored Apr 9, 2018
1 parent 8e04ca0 commit 6d8ef78
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions server/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"io"
"net"

"github.com/appscode/stash/apis/repositories/v1alpha1"
"github.com/appscode/stash/pkg/controller"
"github.com/appscode/stash/pkg/server"
"github.com/spf13/pflag"
Expand Down Expand Up @@ -59,6 +60,19 @@ func (o StashOptions) Config() (*server.StashConfig, error) {
if err := o.RecommendedOptions.ApplyTo(serverConfig); err != nil {
return nil, err
}
serverConfig.OpenAPIConfig = genericapiserver.DefaultOpenAPIConfig(v1alpha1.GetOpenAPIDefinitions, server.Scheme)
serverConfig.OpenAPIConfig.Info.Title = "stash-server"
serverConfig.OpenAPIConfig.Info.Version = v1alpha1.SchemeGroupVersion.Version
serverConfig.OpenAPIConfig.IgnorePrefixes = []string{
"/swaggerapi",
"/apis/admission.stash.appscode.com/v1alpha1/restics",
"/apis/admission.stash.appscode.com/v1alpha1/recoveries",
"/apis/admission.stash.appscode.com/v1alpha1/deployments",
"/apis/admission.stash.appscode.com/v1alpha1/daemonsets",
"/apis/admission.stash.appscode.com/v1alpha1/statefulsets",
"/apis/admission.stash.appscode.com/v1alpha1/replicationcontrollers",
"/apis/admission.stash.appscode.com/v1alpha1/replicasets",
}

controllerConfig := controller.NewControllerConfig(serverConfig.ClientConfig)
if err := o.ControllerOptions.ApplyTo(controllerConfig); err != nil {
Expand Down

0 comments on commit 6d8ef78

Please sign in to comment.