Skip to content

Comments

model: fix edge case for Edm.DateTimeOffset.from_json() without offset#232

Merged
phanak-sap merged 1 commit intomasterfrom
issue-231
Sep 27, 2022
Merged

model: fix edge case for Edm.DateTimeOffset.from_json() without offset#232
phanak-sap merged 1 commit intomasterfrom
issue-231

Conversation

@phanak-sap
Copy link
Contributor

@phanak-sap phanak-sap commented Sep 23, 2022

We were expecting that the offset part is mandatory and that the service should return /Date(1659430517461+0000)/ for offset set to UTC. Unable confirm in odata.org and W3C specifications, but some services (SAP included) works for this Edm type as if offset is not mandatory for the UTC timezone.

Now, if the offset part is missing in incoming JSON payload, it should work as if +0000 was provided.

FIXES #231

@codecov-commenter
Copy link

codecov-commenter commented Sep 23, 2022

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.34%. Comparing base (5d14908) to head (fb21cad).
Report is 30 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #232   +/-   ##
=======================================
  Coverage   92.34%   92.34%           
=======================================
  Files           6        6           
  Lines        2847     2849    +2     
=======================================
+ Hits         2629     2631    +2     
  Misses        218      218           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

We were expecting that the offset part is mandatory and that the service should return /Date(1659430517461+0000)/ for offset set to UTC. Unable confirm in odata.org and W3C specifications, but some services works for this Edm type as offset is not mandatory of UTC timezone.

Now, if the offset part is missing in incoming JSON payload, it should work as if +0000 was provided.

FIXES #231
@jfilak
Copy link
Contributor

jfilak commented Sep 27, 2022

LGTM

@phanak-sap phanak-sap merged commit e28b3ca into master Sep 27, 2022
@phanak-sap phanak-sap deleted the issue-231 branch September 27, 2022 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Malformed value for primitive Edm.DateTimeOffset type

3 participants