schema

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at

http://aws.amazon.com/apache2.0/

or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidEvaluationTypes is returned when the evaluation types are not valid
	// for generating a schema.
	ErrInvalidEvaluationTypes = errors.New("invalid evaluation type")
)

Functions

func ConvertJSONSchemaPropsToSpecSchema

func ConvertJSONSchemaPropsToSpecSchema(props *extv1.JSONSchemaProps) (*spec.Schema, error)

ConvertJSONSchemaPropsToSpecSchema converts an extv1.JSONSchemaProps to a spec.Schema.

NOTE(a-hilaly): there must be an upstream library that does this conversion, but life is too short to find it. So I'm just going to write this function here.

func GenerateSchemaFromEvals

func GenerateSchemaFromEvals(evals map[string][]ref.Val) (*extv1.JSONSchemaProps, error)

func GetResourceTopLevelFieldNames

func GetResourceTopLevelFieldNames(schema *spec.Schema) []string

GetResourceTopLevelFieldNames returns the top level field names of the resource. It walks through the schema of the resource and retrieves the top level fields including spec, status, metadata, etc.

It is up to the caller to sort filter the field names they want.

func NewCombinedResolver

func NewCombinedResolver(clientConfig *rest.Config) (resolver.SchemaResolver, *discovery.DiscoveryClient, error)

NewCombinedResolver creates a new schema resolver that can resolve both core and client types.

Types

This section is empty.

Jump to

Keyboard shortcuts

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