kube-openapik8s.io/kube-openapi/pkg/handler Index | Files

package handler

import "k8s.io/kube-openapi/pkg/handler"

Index

Functions

func PruneDefaults

func PruneDefaults(definitions spec.Definitions) spec.Definitions

PruneDefaults remove all the defaults recursively from all the schemas in the definitions, and does not modify the definitions in place.

func PruneDefaultsSchema

func PruneDefaultsSchema(schema *spec.Schema) *spec.Schema

PruneDefaultsSchema remove all the defaults recursively from the schema in place.

func ToProtoBinary

func ToProtoBinary(json []byte) ([]byte, error)

Types

type OpenAPIService

type OpenAPIService struct {
	// contains filtered or unexported fields
}

OpenAPIService is the service responsible for serving OpenAPI spec. It has the ability to safely change the spec while serving it.

func BuildAndRegisterOpenAPIVersionedService

func BuildAndRegisterOpenAPIVersionedService(servePath string, webServices []*restful.WebService, config *common.Config, handler common.PathHandler) (*OpenAPIService, error)

BuildAndRegisterOpenAPIVersionedService builds the spec and registers a handler to provide access to it. Use this method if your OpenAPI spec is static. If you want to update the spec, use BuildOpenAPISpec then RegisterOpenAPIVersionedService.

Deprecated: BuildAndRegisterOpenAPIVersionedServiceFromRoutes should be used instead.

func BuildAndRegisterOpenAPIVersionedServiceFromRoutes

func BuildAndRegisterOpenAPIVersionedServiceFromRoutes(servePath string, routeContainers []common.RouteContainer, config *common.Config, handler common.PathHandler) (*OpenAPIService, error)

BuildAndRegisterOpenAPIVersionedServiceFromRoutes builds the spec and registers a handler to provide access to it. Use this method if your OpenAPI spec is static. If you want to update the spec, use BuildOpenAPISpec then RegisterOpenAPIVersionedService.

func NewOpenAPIService

func NewOpenAPIService(swagger *spec.Swagger) *OpenAPIService

NewOpenAPIService builds an OpenAPIService starting with the given spec.

func NewOpenAPIServiceLazy

func NewOpenAPIServiceLazy(swagger cached.Value[*spec.Swagger]) *OpenAPIService

NewOpenAPIServiceLazy builds an OpenAPIService from lazy spec.

func RegisterOpenAPIVersionedService

func RegisterOpenAPIVersionedService(spec *spec.Swagger, servePath string, handler common.PathHandler) *OpenAPIService

RegisterOpenAPIVersionedService registers a handler to provide access to provided swagger spec.

Deprecated: use OpenAPIService.RegisterOpenAPIVersionedService instead.

func (*OpenAPIService) RegisterOpenAPIVersionedService

func (o *OpenAPIService) RegisterOpenAPIVersionedService(servePath string, handler common.PathHandler)

RegisterOpenAPIVersionedService registers a handler to provide access to provided swagger spec.

func (*OpenAPIService) UpdateSpec

func (o *OpenAPIService) UpdateSpec(swagger *spec.Swagger) error

func (*OpenAPIService) UpdateSpecLazy

func (o *OpenAPIService) UpdateSpecLazy(swagger cached.Value[*spec.Swagger])

Source Files

default_pruning.go handler.go

Version
v0.0.0-20250318190949-c8a335a9a2ff (latest)
Published
Mar 18, 2025
Platform
linux/amd64
Imports
18 packages
Last checked
3 weeks ago

Tools for package owners.