Skip to content
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

Query format of datetimeoffset with fractionalSeconds #271

Open
mexavier opened this issue Jun 16, 2020 · 2 comments
Open

Query format of datetimeoffset with fractionalSeconds #271

mexavier opened this issue Jun 16, 2020 · 2 comments

Comments

@mexavier
Copy link

Hi,

I'm using OData SDL for few months and I have a question relating on how to format of the datetimeoffset in a query.

According to the BNF, it is written :
dateTimeOffsetValue = year "-" month "-" day "T" hour ":" minute [ ":" second [ "." fractionalSeconds ] ] ( "Z" / sign hour ":" minute )

I try to query with the following format :

  • 2020-06-16T10:46:49.392%2B02:00
  • 2020-06-16T10:46:49%2E392%2B02:00

But I always get the following exception :

2020-06-16 15:53:45 [cher-531]                       ERROR ODataRendererActor$$anonfun$receive$1:52 - Invalid request - com.sdl.odata.api.parser.ODataUriParseException: ''&' expected but 'T' found'
com.sdl.odata.api.parser.ODataUriParseException: '&' expected but 'T' found
        at com.sdl.odata.parser.ODataUriParser.parseUri(ODataUriParser.scala:34)
        at com.sdl.odata.parser.ODataParserImpl.parseUri(ODataParserImpl.java:37)
        at com.sdl.odata.service.actor.ODataParserActor$$anonfun$receive$1.applyOrElse(ODataParserActor.scala:34)
        at akka.actor.Actor.aroundReceive(Actor.scala:517)
        at akka.actor.Actor.aroundReceive$(Actor.scala:515)
        at com.sdl.odata.service.actor.ODataParserActor.aroundReceive(ODataParserActor.scala:27)
        at akka.actor.ActorCell.receiveMessage(ActorCell.scala:592)
        at akka.actor.ActorCell.invoke(ActorCell.scala:561)
        at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:258)
        at akka.dispatch.Mailbox.run(Mailbox.scala:225)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)

Can you tell me if it is possible to query with fractional seconds and if so, how ?

Thank you

Xavier

@alebastrov
Copy link
Contributor

I would try to put just a sign instead of encoded '-', for instance you have to use 2020-06-16T10:46:49.392-02:00

@mexavier
Copy link
Author

I try the following pattern unsuccessfully :

  • 2020-06-16T10:46:49.392-02:00
  • 2020-06-16T10:46:49.392Z
  • 2020-06-16T10:46:49.392+02:00

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

No branches or pull requests

2 participants