fix-openapi-gvk

command
v0.0.57 Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

fix-openapi-gvk injects x-kubernetes-group-version-kind extensions into zz_generated.openapi.go for top-level resource types. openapi-gen omits these extensions, but NewTypeConverter requires them to register types by GVK.

VendorExtensible is an embedded field of spec.Schema, so it must be injected INSIDE spec.Schema{} before its closing brace, not at the OpenAPIDefinition level.

Only types whose properties include "kind", "apiVersion" and "metadata" are considered top-level resources and get the extension injected. List types (names ending in "List") are excluded. Only functions matching --prefix are processed, so types from other API groups are left untouched. The API version is derived from the prefix automatically.

Usage:

go run ./tools/fix-openapi-gvk/main.go \
  --file pkg/generated/openapi/zz_generated.openapi.go \
  --group config.sdcio.dev \
  --prefix config_server_apis_config_v1alpha1

Jump to

Keyboard shortcuts

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