Skip to content

Commit

Permalink
Introduce OpenAPIV3 Schemas
Browse files Browse the repository at this point in the history
Generic APIServers now fail to start if the do not define the  OpenAPIV3
schemas. This commit introduces a change to define the OpenAPIV3 schemas

Signed-off-by: Alexander Greene <greene.al1991@gmail.com>
  • Loading branch information
awgreene authored and tmshort committed Oct 26, 2023
1 parent 28977ca commit a217efc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/package-server/apiserver/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ func (c *Config) Complete(informers informers.SharedInformerFactory) completedCo
c.GenericConfig.OpenAPIConfig.Info.Title = "Package API server"
c.GenericConfig.OpenAPIConfig.Info.Version = strings.Split(c.GenericConfig.Version.String(), "-")[0]

// enable OpenAPIV3 schemas
c.GenericConfig.OpenAPIV3Config = genericapiserver.DefaultOpenAPIConfig(generatedopenapi.GetOpenAPIDefinitions, openapinamer.NewDefinitionNamer(generic.Scheme))
c.GenericConfig.OpenAPIV3Config.Info.Title = "Package API server"
c.GenericConfig.OpenAPIV3Config.Info.Version = strings.Split(c.GenericConfig.Version.String(), "-")[0]

return completedConfig{
CompletedConfig: c.GenericConfig.Complete(informers),
ProviderConfig: &c.ProviderConfig,
Expand Down

0 comments on commit a217efc

Please sign in to comment.