-
Notifications
You must be signed in to change notification settings - Fork 223
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
Fixes the issue where the toString of OffsetDateTime truncates trailing 0's #297
base: master
Are you sure you want to change the base?
Conversation
@mgrumbach This is the reopened PR |
f2cea51
to
3fa3471
Compare
@@ -66,6 +67,8 @@ public class TypeMapper { | |||
private static final HashSet<String> keywords = getKeyWords(); | |||
private static HashMap<String, Class<?>> primitiveClassCache = getPrimitiveClassCache(); | |||
|
|||
private static final DateTimeFormatter DTF = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSX"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the final X correct? If the OffsetDateTime value always has zero offset, then this should work. However, if non-zero offsets are possible, then we probably want XXX to match Salesforce. Note that OffsetDateTime.toString() uses XXXXX.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem I was encountering was that OffsetDataTime.toString uses the shortest of what whats listed in the javadoc, and then salesforce was rejecting the data.
Let me change it and give it a test
Hi @rcunn87 , can you provide the steps you are using to reproduce the issue you are seeing? If you could create an "Issue" that describes the issue and steps to reproduce, and then link it to this PR, that would be very helpful. |
By default OffsetDateTime will truncate trailing Zeros from its toString representation, this change ensures that the trailing zeros will not be truncated
The truncated 0 was causing updates to get rejected because they were not a valid format