-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[BUG] FlatteningSerializer not work correctly for Map/List with final modifier #20150
Comments
@anuchandy @jianghaolu for awareness. |
Another case found:
The escaping of Map get interrupted by the "final" ClassB via https://github.com/Azure/azure-sdk-for-java/blob/azure-core_1.6.0/sdk/core/azure-core/src/main/java/com/azure/core/util/serializer/FlatteningSerializer.java#L121-L123 It could be solved by the "shallow" JsonFlatten (as it will not touch ClassB hence no need to escape propertyB) .However I am not sure what might be the impact of changing behavior from "deep" to "shallow". |
Fixed with ##22591 to allow flattening of static and final variables. |
Describe the bug
A clear and concise description of what the bug is.
It breaks the "dot" in Map key, result in e.g.
{"operation":"Replace","properties":{"tags":{"tag":{"1":"value.1"}}}}
Sample case #20149
Code on https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/core/azure-core/src/main/java/com/azure/core/util/serializer/FlatteningSerializer.java#L106-L122
It happens to track1, reported by Databricks. Checked on track2, still reproducible (though it is now limited to classes annotated with
@JsonFlatten
).I am not able to find good solution for this, as the
Map
orList
might not even be modifiable.Exception or Stack Trace
Add the exception log and stack trace if available
To Reproduce
Steps to reproduce the behavior:
Sample case #20149
Code Snippet
Add the code snippet that causes the issue.
Sample case #20149
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Setup (please complete the following information):
Additional context
Add any other context about the problem here.
Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
The text was updated successfully, but these errors were encountered: