Update dependency go modules for k8s v1.29.0-rc.1
This commit is contained in:
21
vendor/k8s.io/kube-openapi/pkg/spec3/encoding.go
generated
vendored
21
vendor/k8s.io/kube-openapi/pkg/spec3/encoding.go
generated
vendored
@@ -32,6 +32,9 @@ type Encoding struct {
|
||||
|
||||
// MarshalJSON is a custom marshal function that knows how to encode Encoding as JSON
|
||||
func (e *Encoding) MarshalJSON() ([]byte, error) {
|
||||
if internal.UseOptimizedJSONMarshalingV3 {
|
||||
return internal.DeterministicMarshal(e)
|
||||
}
|
||||
b1, err := json.Marshal(e.EncodingProps)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -43,6 +46,16 @@ func (e *Encoding) MarshalJSON() ([]byte, error) {
|
||||
return swag.ConcatJSON(b1, b2), nil
|
||||
}
|
||||
|
||||
func (e *Encoding) MarshalNextJSON(opts jsonv2.MarshalOptions, enc *jsonv2.Encoder) error {
|
||||
var x struct {
|
||||
EncodingProps encodingPropsOmitZero `json:",inline"`
|
||||
spec.Extensions
|
||||
}
|
||||
x.Extensions = internal.SanitizeExtensions(e.Extensions)
|
||||
x.EncodingProps = encodingPropsOmitZero(e.EncodingProps)
|
||||
return opts.MarshalNext(enc, x)
|
||||
}
|
||||
|
||||
func (e *Encoding) UnmarshalJSON(data []byte) error {
|
||||
if internal.UseOptimizedJSONUnmarshalingV3 {
|
||||
return jsonv2.Unmarshal(data, e)
|
||||
@@ -82,3 +95,11 @@ type EncodingProps struct {
|
||||
// AllowReserved determines whether the parameter value SHOULD allow reserved characters, as defined by RFC3986
|
||||
AllowReserved bool `json:"allowReserved,omitempty"`
|
||||
}
|
||||
|
||||
type encodingPropsOmitZero struct {
|
||||
ContentType string `json:"contentType,omitempty"`
|
||||
Headers map[string]*Header `json:"headers,omitempty"`
|
||||
Style string `json:"style,omitempty"`
|
||||
Explode bool `json:"explode,omitzero"`
|
||||
AllowReserved bool `json:"allowReserved,omitzero"`
|
||||
}
|
||||
|
Reference in New Issue
Block a user