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

[API v2] Date time does not validate properly if the timezone is used #5848

Closed
DaazKu opened this issue Aug 14, 2017 · 1 comment
Closed

Comments

@DaazKu
Copy link
Contributor

DaazKu commented Aug 14, 2017

Calling http://vanilla.dev/api/v2/comments?discussionid=30 yields:

[
    {
        "commentID": 7,
        "discussionID": 30,
        "body": "<p>comment 1</p>\n",
        "format": "Markdown",
        "dateInserted": "2017-07-27T19:26:24+00:00",
        "insertUserID": 2,
        "url": "http://vanilla.dev/discussion/comment/7#Comment_7"
    },
    {
        "commentID": 8,
        "discussionID": 30,
        "body": "<p>comment 2</p>\n",
        "format": "Markdown",
        "dateInserted": "2017-07-27T19:26:28+00:00",
        "insertUserID": 2,
        "url": "http://vanilla.dev/discussion/comment/8#Comment_8"
    },
    {
        "commentID": 9,
        "discussionID": 30,
        "body": "<p>comment 3</p>\n",
        "format": "Markdown",
        "dateInserted": "2017-07-27T19:26:33+00:00",
        "insertUserID": 2,
        "url": "http://vanilla.dev/discussion/comment/9#Comment_9"
    },
    {
        "commentID": 12,
        "discussionID": 30,
        "body": "<p>asd</p>\n",
        "format": "Markdown",
        "dateInserted": "2017-08-14T14:42:58+00:00",
        "insertUserID": 2,
        "url": "http://vanilla.dev/discussion/comment/12#Comment_12"
    }
]

You get an error using the dateInserted field as the after parameter like so http://vanilla.dev/api/v2/comments?discussionid=30&after=2017-07-27T19:26:24+00:00

{
    "message": "after is not a valid datetime.",
    "status": 422,
    "errors": [
        {
            "field": "after",
            "code": "invalid",
            "message": "after is not a valid datetime."
        }
    ]
}

This is counter intuitive because the return type of dateInserted is DateTime... It should work properly

@initvector
Copy link
Contributor

Issue moved to vanilla/garden-schema #16 via ZenHub

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