As deepmap/oapi-codegen didn't work with this newer version, upgrade to oapi-codegen/oapi-codegen v2. Mitigating CVE-2025-30153
19 lines
342 B
Go
19 lines
342 B
Go
package overlay
|
|
|
|
import (
|
|
"fmt"
|
|
"gopkg.in/yaml.v3"
|
|
)
|
|
|
|
func NewTargetSelector(path, method string) string {
|
|
return fmt.Sprintf(`$["paths"]["%s"]["%s"]`, path, method)
|
|
}
|
|
|
|
func NewUpdateAction(path, method string, update yaml.Node) Action {
|
|
target := NewTargetSelector(path, method)
|
|
|
|
return Action{
|
|
Target: target,
|
|
Update: update,
|
|
}
|
|
}
|