diff --git a/doc/client/flow/voting.rst b/doc/client/flow/voting.rst index 0fc59fc..67df713 100644 --- a/doc/client/flow/voting.rst +++ b/doc/client/flow/voting.rst @@ -19,7 +19,7 @@ A typical voting/check results flow would be: .. sourcecode:: http HTTP/1.1 404 Not Found - Content-Type: text/json + Content-Type: application/json { "status": "ERROR", "code": "UserNotFound", diff --git a/doc/client/index.rst b/doc/client/index.rst index 32c5689..b875339 100644 --- a/doc/client/index.rst +++ b/doc/client/index.rst @@ -23,7 +23,7 @@ The response will always be: .. sourcecode:: http HTTP/1.1 400 Bad Request - Content-Type: text/json + Content-Type: application/json { "status": "ERROR", "message": "Request MUST be in JSON format" } @@ -33,7 +33,7 @@ If instead you do a proper JSON request with: POST /randomendpoint Host: example.com - Content-type: text/json + Content-type: application/json { "field1": "value", "field2": "value" } diff --git a/luncho/blueprints/groups.py b/luncho/blueprints/groups.py index af170b6..945ab6a 100644 --- a/luncho/blueprints/groups.py +++ b/luncho/blueprints/groups.py @@ -47,7 +47,7 @@ def user_groups(): .. sourcecode:: http HTTP/1.1 200 OK - Content-Type: text/json + Content-Type: application/json { "status": "OK", "groups": [ { "id": "" , "name": "", @@ -93,7 +93,7 @@ def create_group(): .. sourcecode:: http HTTP/1.1 200 OK - Content-Type: text/json + Content-Type: application/json { "status": "OK", "id": } @@ -248,7 +248,7 @@ def add_users_to_group(group_id): .. sourcecode:: http HTTP/1.1 200 OK - Content-Type: text/json + Content-Type: application/json { "status": "OK", "not_found": [, , ...] } @@ -301,7 +301,7 @@ def list_group_members(group_id): .. sourcecode:: http HTTP/1.1 200 OK - Content-Type: text/json + Content-Type: application/json { "status": "OK", "users": [ { "username": "", "full_name": ""}, @@ -356,7 +356,7 @@ def get_group_places(group_id): .. sourcecode:: http HTTP/1.1 200 OK - Content-Type: text/json + Content-Type: application/json { "status": "OK", "places": [ { "id": "", "name": ""}, @@ -408,7 +408,7 @@ def group_add_places(group_id): .. sourcecode:: http HTTP/1.1 200 OK - Content-Type: text/json + Content-Type: application/json { "status": "OK", "rejected": [, , ...], diff --git a/luncho/blueprints/places.py b/luncho/blueprints/places.py index 0894591..ff5f5a9 100644 --- a/luncho/blueprints/places.py +++ b/luncho/blueprints/places.py @@ -77,7 +77,7 @@ def get_places(): .. sourcecode:: http HTTP/1.1 200 OK - Content-Type: text/json + Content-Type: application/json { "status": "OK", "places": [ { "id": "", "name": "", diff --git a/luncho/blueprints/token.py b/luncho/blueprints/token.py index 2e333f1..633534c 100644 --- a/luncho/blueprints/token.py +++ b/luncho/blueprints/token.py @@ -24,7 +24,7 @@ class UserDoesNotExistException(LunchoException): .. sourcecode:: http HTTP/1.1 404 Not found - Content-Type: text/json + Content-Type: application/json { "status": "ERROR", "message": "User does not exist" } """ @@ -40,7 +40,7 @@ class InvalidPasswordException(LunchoException): .. sourcecode:: http HTTP/1.1 401 Unauthorized - Content-Type: text/json + Content-Type: application/json { "status": "ERROR", "message": "Invalid password" } """ @@ -74,7 +74,7 @@ def get_token(): .. sourcecode:: http HTTP/1.1 200 OK - Content-Type: text/json + Content-Type: application/json { "status": "OK", "token": "access_token" } diff --git a/luncho/blueprints/users.py b/luncho/blueprints/users.py index 9658fdc..cae2843 100644 --- a/luncho/blueprints/users.py +++ b/luncho/blueprints/users.py @@ -30,7 +30,7 @@ class UsernameAlreadyExistsException(LunchoException): ..sourcecode:: http HTTP/1.1 409 Conflict - Content-Type: text/json + Content-Type: application/json { "status": "ERROR", "message": "Username already exists" } """ @@ -58,7 +58,7 @@ def create_user(): .. sourcecode:: http HTTP/1.1 200 OK - Content-Type: text/json + Content-Type: application/json { "status": "OK" } @@ -109,7 +109,7 @@ def update_user(): .. sourcecode:: http HTTP/1.1 200 OK - Content-Type: text/json + Content-Type: application/json { "status": "OK" } @@ -148,7 +148,7 @@ def delete_user(): .. sourcecode:: http HTTP/1.1 200 OK - Content-Type: text/json + Content-Type: application/json { "status": "OK" } diff --git a/luncho/blueprints/voting.py b/luncho/blueprints/voting.py index c769067..24b4dc4 100644 --- a/luncho/blueprints/voting.py +++ b/luncho/blueprints/voting.py @@ -39,7 +39,7 @@ class VoteAlreadyCastException(LunchoException): .. sourcecode:: http HTTP/1.1 406 Not Acceptable - Content-Type: text/json + Content-Type: application/json { "status": "ERROR", "message": "User already voted today" } """ @@ -54,7 +54,7 @@ class InvalidNumberOfPlacesCastedException(LunchoException): .. sourcecode:: http HTTP/1.1 406 Not Acceptable - Content-Type: text/json + Content-Type: application/json { "status": "ERROR", "message": "The vote must register {places} places" } @@ -71,7 +71,7 @@ class PlaceDoesntBelongToGroupException(LunchoException): .. sourcecode:: http http/1.1 404 Not Found - Content-Type: text/json + Content-Type: application/json { "status": "ERROR", "message": "Places are not part of this group", @@ -94,7 +94,7 @@ class PlacesVotedMoreThanOnceException(LunchoException): .. sourcecode:: http HTTP/1.1 409 Conflict - Content-Type: text/json + Content-Type: application/json { "status": "ERROR", "message": "Places voted more than once", @@ -208,7 +208,7 @@ def get_vote(group_id): .. sourcecode:: http HTTP/1.1 200 OK - Content-type: text/json + Content-type: application/json { "status": "OK", "closed": , diff --git a/luncho/exceptions.py b/luncho/exceptions.py index 1f57cde..5bd1e35 100644 --- a/luncho/exceptions.py +++ b/luncho/exceptions.py @@ -36,7 +36,7 @@ class RequestMustBeJSONException(LunchoException): ..sourcecode:: http HTTP/1.1 400 Bad Request - Content-Type: text/json + Content-Type: application/json { "status": "ERROR", "message": "Request MUST be in JSON format" } """ @@ -52,7 +52,7 @@ class MissingFieldsException(LunchoException): ..sourcecode:: http HTTP/1.1 400 Bad Request - Content-Type: text/json + Content-Type: application/json { "status": "ERROR", "message": "Missing fields", @@ -71,7 +71,7 @@ class InvalidTokenException(LunchoException): ..sourcecode:: http HTTP/1.1 400 Bad Request - Content-Type: text/json + Content-Type: application/json { "status": "ERROR", "message": "Invalid token" } """ @@ -87,7 +87,7 @@ class UserNotFoundException(LunchoException): ..sourccode:: http HTTP/1.1 404 Not Found - Content-Type: text/json + Content-Type: application/json { "status": "ERROR", "message": "User not found (via token)" } @@ -104,7 +104,7 @@ class ElementNotFoundException(LunchoException): ..sourcecode:: http HTTP/1.1 404 Not Found - Content-Type: text/json + Content-Type: application/json { "status": "ERROR", "message": "{element} not found" } @@ -122,7 +122,7 @@ class AuthorizationRequiredException(LunchoException): ..sourcecode:: http HTTP/1.1 401 Unauthorized - Content-Type: text/json + Content-Type: application/json { "status": "ERROR": "message": "Request requires authentication" } """ @@ -138,7 +138,7 @@ class AccountNotVerifiedException(LunchoException): .. sourcecode:: http HTTP/1.1 412 Precondition Failed - Content-Type: test/json + Content-Type: application/json { "status": "ERROR", "message": "Account not verified" } """ @@ -154,7 +154,7 @@ class NewMaintainerDoesNotExistException(LunchoException): .. sourcecode:: http HTTP/1.1 404 Not found - Content-Type: test/json + Content-Type: application/json { "status": "ERROR", "message": "New admin not found" } """ @@ -170,7 +170,7 @@ class UserIsNotAdminException(LunchoException): .. sourcecode:: http HTTP/1.1 403 Forbidden - Content-Type: test/json + Content-Type: application/json { "status": "ERROR", "message": "User is not admin" } """ @@ -186,7 +186,7 @@ class UserIsNotMemberException(LunchoException): .. sourcecode:: http HTTP/1.1 403 Forbidden - Content-Type: test/json + Content-Type: application/json { "status": "ERROR", "message": "User is not member of this group" } """