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

If data is not provided, then don't raise a missing but default to empty. #63

Merged
merged 4 commits into from
Aug 14, 2015

Conversation

Natim
Copy link
Member

@Natim Natim commented Jul 17, 2015

$ http PUT http://localhost:8888/v1/buckets/toto --auth="admin:"
HTTP/1.1 400 Bad Request
Access-Control-Expose-Headers: Backoff, Retry-After, Alert
Content-Length: 159
Content-Type: application/json; charset=UTF-8
Date: Tue, 16 Jun 2015 09:47:26 GMT
Server: waitress

{
    "code": 400, 
    "details": [
        {
            "description": "data is missing", 
            "location": "body", 
            "name": "data"
        }
    ], 
    "errno": 107, 
    "error": "Invalid parameters", 
    "message": "data is missing"
}

It should be:

$ http PUT http://localhost:8888/v1/buckets/toto --auth="admin:"
HTTP/1.1 201 Created
Access-Control-Expose-Headers: Backoff, Retry-After, Alert
Content-Length: 69
Content-Type: application/json; charset=UTF-8
Date: Tue, 16 Jun 2015 09:47:49 GMT
Server: waitress

{
    "data": {
        "id": "toto", 
        "last_modified": 1434455269317
    }, 
    "permissions": {}
}

@leplatrem
Copy link
Contributor

+1

@Natim
Copy link
Member Author

Natim commented Jul 17, 2015

I changed the tests to reflect the expected behavior with the cliquet change in mozilla-services/cliquet#397

@Natim
Copy link
Member Author

Natim commented Jul 17, 2015

Needs mozilla-services/cliquet#398

@leplatrem
Copy link
Contributor

KeyError permissions

File "loadtest/tutorial.py", line 149, in play_user_shared_bucket_tutorial

    self.assertIn('write', record['permissions'])

leplatrem added a commit that referenced this pull request Aug 14, 2015
Do not provide data in payload if no schema
@leplatrem leplatrem merged commit 803aea1 into master Aug 14, 2015
@leplatrem leplatrem deleted the 63-accept-empty-data branch August 14, 2015 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants