question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot remove metadata entries with typed / builder update params

See original GitHub issue

Note: I’ve noticed that with issuing authorizations and transactions but this might be happening with other objects as well.

To try and remove a metadata entry (currently set to "foo": "bar") I try the following:

authorization.update(AuthorizationUpdateParams.builder()
        .putMetadata("foo", null)
        .build());

However this does not seem to make any change to the object (the metadata entry is still there with the old value).

I tried calling .putMetadata("foo", "") but the SDK rejects empty strings.

The workaround I found was to call:

authorization.update(AuthorizationUpdateParams.builder()
        .putExtraParam("metadata[foo]", EmptyParam.EMPTY)
        .build());

which worked.

Should it be possible to remove metadata entries with putMetadata?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ob-stripecommented, Nov 9, 2019

Just a quick note that I was able to reproduce the issue. I have a fair idea of what causes this bug, but it’s going to be tricky to fix. We’ll post an update here when we’ve made some progress. Thanks for your patience!

0reactions
ob-stripecommented, Nov 18, 2019

This should be fixed in the latest version, v15.3.1.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to delete an enum type value in postgres? - Stack Overflow
Looks good, but I am getting ERROR: cannot cast type unit_enum_old to unit_enum . Probably some cast is required additionally. I am 146%...
Read more >
Metadata Types | Metadata API Developer Guide
Represents a text-based code structure of the settings and site components, such as pages, branding sets, and themes, that make up an Experience...
Read more >
Metadata API Developer Guide
Metadata is data that describes other data. To understand how Salesforce defines metadata, contrast business data with Salesforce metadata.
Read more >
Content Management API | Contentful
Deleting a space will remove all its resources, including content types, entries and assets. This action can not be undone.
Read more >
Model Binding in ASP.NET Core | Microsoft Learn
Causes model binding to add a model state error if binding cannot ... For record types, validation and binding metadata on parameters is ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found