Skip to content

Commit

Permalink
Merge pull request #3543 from Azure/mociarain/remove-ErrorIfNoField
Browse files Browse the repository at this point in the history
Drop ErrorIfNoField
  • Loading branch information
bennerv committed Apr 28, 2024
2 parents f62c65d + 3c3088e commit ec4f2b5
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 19 deletions.
8 changes: 1 addition & 7 deletions pkg/api/pretty.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,7 @@ import (
var secretPreservingJSONHandle *codec.JsonHandle

func init() {
secretPreservingJSONHandle = &codec.JsonHandle{
BasicHandle: codec.BasicHandle{
DecodeOptions: codec.DecodeOptions{
ErrorIfNoField: true,
},
},
}
secretPreservingJSONHandle = &codec.JsonHandle{}

err := secretPreservingJSONHandle.SetInterfaceExt(reflect.TypeOf(SecureBytes{}), 1, secureHidingExt{})
if err != nil {
Expand Down
8 changes: 1 addition & 7 deletions pkg/database/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,7 @@ func getDatabaseKey(keys sdkcosmos.DatabaseAccountsClientListKeysResponse, log *
}

func NewJSONHandle(aead encryption.AEAD) (*codec.JsonHandle, error) {
h := &codec.JsonHandle{
BasicHandle: codec.BasicHandle{
DecodeOptions: codec.DecodeOptions{
ErrorIfNoField: true,
},
},
}
h := &codec.JsonHandle{}

if aead == nil {
return h, nil
Expand Down
5 changes: 0 additions & 5 deletions pkg/frontend/subscriptions_put.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,6 @@ func (f *frontend) _putSubscription(ctx context.Context, r *http.Request) ([]byt
oldState := doc.Subscription.State

h := &codec.JsonHandle{
BasicHandle: codec.BasicHandle{
DecodeOptions: codec.DecodeOptions{
ErrorIfNoField: true,
},
},
Indent: 4,
}

Expand Down

0 comments on commit ec4f2b5

Please sign in to comment.