postprocess

command
v1.16.0 Latest Latest
Warning

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

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

Documentation

Overview

Command postprocess applies transformations to generated.go to fix conflicts introduced by oapi-codegen that cannot be resolved via configuration alone.

Transformations applied:

  1. Rename symbols that conflict with the public API of this package (ClientOption, NewClient, WithHTTPClient, WithBaseURL, PrometheusRule, and the PrometheusResultType "string" enum value, which oapi-codegen names String and would clash with the hand-written String helper). oapi-codegen does not provide a configuration option to rename these. Selector members (e.g. url.URL.String()) are left untouched so the rename never rewrites a method or field access on a different type.
  2. Remove deprecated fields from PrometheusAlertRule (Description, Summary, and the deprecated KeepFiringFor) since these have been replaced by annotations and the snake_case keep_firing_for field respectively.
  3. Strip YAML handling (the gopkg.in/yaml.v2 import, response struct fields named YAML*, and switch cases that call yaml.Unmarshal). The root package must not depend on any YAML library; YAML support belongs in the yaml/ subpackage, and the TestNoYAMLDependency guard test enforces this.

Usage: go run ./tools/postprocess generated.go

Jump to

Keyboard shortcuts

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