sentry-docs
sentry-docs copied to clipboard
Java Contexts example should use complex object
Contexts expects an object to be serialized. A String will not be accepted.
https://docs.sentry.io/platforms/java/enriching-events/context/
One alternative is to declare type above and pass an instance, as done in other platforms such as Flutter:
https://docs.sentry.io/platforms/flutter/enriching-events/context/
@bruno-garcia the Java code will wrap the primitive types or String within an Object with a value field:
it'd become:
"key": {
"value": your primitive value or String
}
so it's not broken, but it'd be better to align the examples using an object instead, true.
I forgot the work around, I think we should do this everywhere we take Object such as .NET.
Do we create a new key if that already exists? Or will we just override the same key and only the last value set will take effect?
afaik, it always overwrites it
This issue has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Accepted, I will leave it alone ... forever!
"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀