apiextensions-apiserverk8s.io/apiextensions-apiserver/pkg/controller/openapi/builder Index | Files

package builder

import "k8s.io/apiextensions-apiserver/pkg/controller/openapi/builder"

Index

Functions

func BuildSwagger

func BuildSwagger(crd *apiextensionsv1.CustomResourceDefinition, version string, opts Options) (*spec.Swagger, error)

BuildSwagger builds swagger for the given crd in the given version

func MergeSpecs

func MergeSpecs(staticSpec *spec.Swagger, crdSpecs ...*spec.Swagger) (*spec.Swagger, error)

MergeSpecs aggregates all OpenAPI specs, reusing the metadata of the first, static spec as the basis. The static spec has the highest priority, and its paths and definitions won't get overlapped by user-defined CRDs. None of the input is mutated, but input and output share data structures.

Types

type CRDCanonicalTypeNamer

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

CRDCanonicalTypeNamer implements CanonicalTypeNamer interface for CRDs to seed kube-openapi canonical type name without Go types

func (*CRDCanonicalTypeNamer) OpenAPICanonicalTypeName

func (c *CRDCanonicalTypeNamer) OpenAPICanonicalTypeName() string

OpenAPICanonicalTypeName returns canonical type name for given CRD

type Options

type Options struct {
	// Convert to OpenAPI v2.
	V2 bool

	// Strip defaults.
	StripDefaults bool

	// Strip value validation.
	StripValueValidation bool

	// Strip nullable.
	StripNullable bool

	// AllowNonStructural indicates swagger should be built for a schema that fits into the structural type but does not meet all structural invariants
	AllowNonStructural bool
}

Options contains builder options.

Source Files

builder.go merge.go

Version
v0.19.3
Published
Oct 20, 2020
Platform
js/wasm
Imports
27 packages
Last checked
35 minutes ago

Tools for package owners.