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 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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