const metadataGV … const autoscalingGV … // MergeSpecs aggregates all OpenAPI specs, reusing the metadata of the first, static spec as the basis. // The static spec has the highest priority, and its paths and definitions won't get overlapped by // user-defined CRDs. None of the input is mutated, but input and output share data structures. func MergeSpecs(staticSpec *spec.Swagger, crdSpecs ...*spec.Swagger) (*spec.Swagger, error) { … } // mergeSpec copies paths, parameters and definitions from source to dest, mutating dest, but not source. // We assume that conflicts do not matter. func mergeSpec(dest, source *spec.Swagger) { … } // MergeSpecsV3 merges OpenAPI v3 specs for CRDs // Conflicts belonging to the meta.v1 or autoscaling.v1 group versions are skipped as all CRDs reference those types // Other conflicts will result in an error func MergeSpecsV3(crdSpecs ...*spec3.OpenAPI) (*spec3.OpenAPI, error) { … } // mergeSpecV3 copies paths and definitions from source to dest, mutating dest, but not source. // Conflicts belonging to the meta.v1 or autoscaling.v1 group versions are skipped as all CRDs reference those types // Other conflicts will result in an error func mergeSpecV3(dest, source *spec3.OpenAPI) error { … }