Version: v0.24.2 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Jun 17, 2022 License: Apache-2.0 Imports: 10 Imported by: 46




This section is empty.


This section is empty.


func ConvertJSONSchemaProps

func ConvertJSONSchemaProps(in *apiextensions.JSONSchemaProps, out *spec.Schema) error

ConvertJSONSchemaProps converts the schema from apiextensions.JSONSchemaPropos to go-openapi/spec.Schema.

func ConvertJSONSchemaPropsWithPostProcess

func ConvertJSONSchemaPropsWithPostProcess(in *apiextensions.JSONSchemaProps, out *spec.Schema, postProcess PostProcessFunc) error

ConvertJSONSchemaPropsWithPostProcess converts the schema from apiextensions.JSONSchemaPropos to go-openapi/spec.Schema and run a post process step on each JSONSchemaProps node. postProcess is never called for nil schemas.

func NewSchemaValidator

func NewSchemaValidator(customResourceValidation *apiextensions.CustomResourceValidation) (*validate.SchemaValidator, *spec.Schema, error)

NewSchemaValidator creates an openapi schema validator for the given CRD validation.

func StripUnsupportedFormatsPostProcess added in v0.17.0

func StripUnsupportedFormatsPostProcess(s *spec.Schema) error

StripUnsupportedFormatsPostProcess sets unsupported formats to empty string.

func ValidateCustomResource

func ValidateCustomResource(fldPath *field.Path, customResource interface{}, validator *validate.SchemaValidator) field.ErrorList

ValidateCustomResource validates the Custom Resource against the schema in the CustomResourceDefinition. CustomResource is a JSON data structure.


type PostProcessFunc

type PostProcessFunc func(*spec.Schema) error

PostProcessFunc post-processes one node of a spec.Schema.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL