vendor in latests containers/(storage, common, build, image)

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
Daniel J Walsh
2023-01-18 13:09:44 -05:00
parent ac1530b14e
commit f65d79f4c7
383 changed files with 66625 additions and 138 deletions

View File

@ -0,0 +1,29 @@
// Package schutils provides tools to save or clone a schema
// when flattening a spec.
package schutils
import (
"github.com/go-openapi/spec"
"github.com/go-openapi/swag"
)
// Save registers a schema as an entry in spec #/definitions
func Save(sp *spec.Swagger, name string, schema *spec.Schema) {
if schema == nil {
return
}
if sp.Definitions == nil {
sp.Definitions = make(map[string]spec.Schema, 150)
}
sp.Definitions[name] = *schema
}
// Clone deep-clones a schema
func Clone(schema *spec.Schema) *spec.Schema {
var sch spec.Schema
_ = swag.FromDynamicJSON(schema, &sch)
return &sch
}