mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
vendor: bump k8s dependencies to v0.29.2
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
36
vendor/k8s.io/kube-openapi/pkg/validation/spec/parameter.go
generated
vendored
36
vendor/k8s.io/kube-openapi/pkg/validation/spec/parameter.go
generated
vendored
@ -36,6 +36,17 @@ type ParamProps struct {
|
||||
AllowEmptyValue bool `json:"allowEmptyValue,omitempty"`
|
||||
}
|
||||
|
||||
// Marshaling structure only, always edit along with corresponding
|
||||
// struct (or compilation will fail).
|
||||
type paramPropsOmitZero struct {
|
||||
Description string `json:"description,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
In string `json:"in,omitempty"`
|
||||
Required bool `json:"required,omitzero"`
|
||||
Schema *Schema `json:"schema,omitzero"`
|
||||
AllowEmptyValue bool `json:"allowEmptyValue,omitzero"`
|
||||
}
|
||||
|
||||
// Parameter a unique parameter is defined by a combination of a [name](#parameterName) and [location](#parameterIn).
|
||||
//
|
||||
// There are five possible parameter types.
|
||||
@ -109,19 +120,18 @@ func (p *Parameter) UnmarshalNextJSON(opts jsonv2.UnmarshalOptions, dec *jsonv2.
|
||||
if err := p.Refable.Ref.fromMap(x.Extensions); err != nil {
|
||||
return err
|
||||
}
|
||||
x.Extensions.sanitize()
|
||||
if len(x.Extensions) == 0 {
|
||||
x.Extensions = nil
|
||||
}
|
||||
p.CommonValidations = x.CommonValidations
|
||||
p.SimpleSchema = x.SimpleSchema
|
||||
p.VendorExtensible.Extensions = x.Extensions
|
||||
p.Extensions = internal.SanitizeExtensions(x.Extensions)
|
||||
p.ParamProps = x.ParamProps
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalJSON converts this items object to JSON
|
||||
func (p Parameter) MarshalJSON() ([]byte, error) {
|
||||
if internal.UseOptimizedJSONMarshaling {
|
||||
return internal.DeterministicMarshal(p)
|
||||
}
|
||||
b1, err := json.Marshal(p.CommonValidations)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -144,3 +154,19 @@ func (p Parameter) MarshalJSON() ([]byte, error) {
|
||||
}
|
||||
return swag.ConcatJSON(b3, b1, b2, b4, b5), nil
|
||||
}
|
||||
|
||||
func (p Parameter) MarshalNextJSON(opts jsonv2.MarshalOptions, enc *jsonv2.Encoder) error {
|
||||
var x struct {
|
||||
CommonValidations commonValidationsOmitZero `json:",inline"`
|
||||
SimpleSchema simpleSchemaOmitZero `json:",inline"`
|
||||
ParamProps paramPropsOmitZero `json:",inline"`
|
||||
Ref string `json:"$ref,omitempty"`
|
||||
Extensions
|
||||
}
|
||||
x.CommonValidations = commonValidationsOmitZero(p.CommonValidations)
|
||||
x.SimpleSchema = simpleSchemaOmitZero(p.SimpleSchema)
|
||||
x.Extensions = internal.SanitizeExtensions(p.Extensions)
|
||||
x.ParamProps = paramPropsOmitZero(p.ParamProps)
|
||||
x.Ref = p.Refable.Ref.String()
|
||||
return opts.MarshalNext(enc, x)
|
||||
}
|
||||
|
Reference in New Issue
Block a user