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