-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gson annotation is ignored #400
Labels
Comments
ghost
added
the
Needs: Triage (Functions)
label
Sep 11, 2020
Merged
This was referenced Sep 16, 2020
The fix had been rolled out for both linux and windows. |
Related work: #559 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Repro steps
Provide the steps required to reproduce the problem:
UserTestObject.java
Function.java
Run with the Azure Functions Java Worker with 1.7.1+ release that has shading for all libraries.
Send a http request.
However, after a recent Runtime update, it is now returning. (Results from the Function App on cloud with the latest Runtime)
{
"prop1": "ABCDE",
"prop2": "Microsoft",
"prop3": "Test",
"prop4": "Test@Test.Test"
}
Actual behavior
Known workarounds
Pin back to the The old version. For example,
Related information
The root cause is, we introduced shading to avoid conflict of the libraries.
https://github.com/Azure/azure-functions-java-worker/releases/tag/1.7.1
In this case, the @SerializedName is ignored. The reason is, the java worker using shading Gson that package name is
com.microsoft.azure.functions.shaded.com.google.gson.annotations
. However, Gson on the customer side package iscom.google.gson.annotations
that is why the annotation is ignored.Set the break point here, you can find the gson is shaded. However, target class is not shaded. That is why the annotation is ignored.
https://github.com/Azure/azure-functions-java-worker/blob/dev/src/main/java/com/microsoft/azure/functions/worker/binding/RpcUnspecifiedDataTarget.java#L68
This PR will fix this issue.
#399
The text was updated successfully, but these errors were encountered: