generator

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Overview

Package generator generates language-specific schemas for Crossplane and Kubernetes resources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToJSONSchema added in v2.4.0

func ToJSONSchema(s any, gvk runtimeSchema.GroupVersionKind) (*jsonschema.Schema, error)

ToJSONSchema converts any JSON-compatible schema (e.g., *spec.Schema or *extv1.JSONSchemaProps) to a *jsonschema.Schema with YAML language server compatibility fixes applied. When gvk is non-empty, it also sets $id and x-kubernetes-group-version-kind metadata.

Types

type Interface

type Interface interface {
	Language() string
	GenerateFromCRD(ctx context.Context, fs afero.Fs, runner runner.SchemaRunner) (afero.Fs, error)
	GenerateFromOpenAPI(ctx context.Context, fs afero.Fs, runner runner.SchemaRunner) (afero.Fs, error)
}

Interface generates schemas for a specific language.

func AllLanguages

func AllLanguages() []Interface

AllLanguages returns generators for all supported languages. The set of supported language identifiers is defined by devv1alpha1.SupportedSchemaLanguages.

func Filter added in v2.4.0

func Filter(all []Interface, langs []string) []Interface

Filter returns the subset of generators whose language identifier appears in langs. The order of generators in the result matches the order of all. If langs is empty, all generators are returned unchanged.

Jump to

Keyboard shortcuts

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