-
Notifications
You must be signed in to change notification settings - Fork 284
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
Unable to get correct format for date with Odata 2.0 service #953
Comments
Thanks for the report. Would you be able to submit a patch? |
Hello, We suggest to rely on the client version that can be defined in the Service class. Then we change the methods in TypeUtils (toEdm, toEdmDateTime) to pass the version as parameter, and finally introduce some logic to choose the date format based on the version (with the adding of the new format) If you're fine with this solution we can submit it, we just wanted to check with you first as we're new to this framework, we wanted to be sure we got it right. Cheers |
BTW, We just saw that implementation for Odata 3.0 is not done yet so we were wondering which version is officially supported by Restlet. Was it just a bug or is it an older version (before 2.0) which is supported. |
There was a recent contribution to support OData 3.0 here that looks great: Note that there is no guarantee at this point that this contribution will be merged in the RF code base, but we hope so :) There is an ongoing legal process to complete the submission, but you might want to have a look and try the new code. I'm cc:ing @Landmark-LGC who might be able to update us. |
I think we support OData 1.0 as this feature was added back in 2010: I've updated the user guide source to reflect this: Regarding your patch idea, it sounds good to me. Distinguishing between different versions of OData protocol seems important. |
Is this related to #946? |
Hello, I don't think so, the issue #946 is about receiving dates while we are talking about choosing the format for sending it. |
Hello, we have implemented a fix but i can't succeed in building the framework locally, the ant command stays stuck on [junit] Running org.restlet.test.RestletTestSuite. Even though i did not change anything in the Test module yet. Have you ever experienced that issue ? Would you have any documentation on building locally ? I'm not used to Ant so maybe it's just a small thing... Would it be possible to have a direct contact to discuss it ? (skype or phone..) Thank you |
Hello, you could rely on Travis CI to check if your code works: Otherwise, you can find instructions to build here: |
BTW, you have my email on my GitHub profile page if needed |
Hello,
We're trying to implement a client for an odata service using 2.0 version of odata.
From official spec we can see that format should be:
datetime’yyyy-mm-ddThh:mm[:ss[.fffffff]]‘ (keyword "datetime" and no timezone)
http://www.odata.org/documentation/odata-version-2-0/atom-format
http://www.odata.org/documentation/odata-version-2-0/overview
However, we can not make restlet to use the correct format,
From the code we can see that it uses the format defined in field dateTimeFormats of TypeUtils (org.restlet.ext.odata.internal.edm) which is "yyyy-MM-dd'T'HH:mm:ssz".
This is valid for the 3.0 version of odata but not in 2.0.
The text was updated successfully, but these errors were encountered: