You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I runned schemathesis on django-ninja-jwt, it found several problems:
____________________________ test_api[POST /api/token/refresh] ____________________________
.venv/lib/python3.12/site-packages/schemathesis/_hypothesis.py:81: in test_api
def test_function(*args: Any, **kwargs: Any) -> Any:
tests/test_schemathesis/test_schema.py:15: in test_api
case.call_and_validate(base_url=str(live_server))
E schemathesis.exceptions.CheckFailed:
E
E 1. Undocumented HTTP status code
E
E Received: 400
E Documented: 200
E
E [400] Bad Request:
E
E `{"detail": "Invalid input.", "code": "invalid", "refresh": "token is required"}`
E
E Reproduce with:
E
E curl -X POST -H 'Content-Type: application/json' -d '{"refresh": ""}' http://localhost/api/token/refresh
____________________________ test_api[POST /api/token/verify] _____________________________
.venv/lib/python3.12/site-packages/schemathesis/_hypothesis.py:81: in test_api
def test_function(*args: Any, **kwargs: Any) -> Any:
tests/test_schemathesis/test_schema.py:15: in test_api
case.call_and_validate(base_url=str(live_server))
E schemathesis.exceptions.CheckFailed:
E
E 1. Undocumented HTTP status code
E
E Received: 400
E Documented: 200
E
E [400] Bad Request:
E
E `{"detail": "Invalid input.", "code": "invalid", "token": "token is required"}`
E
E Reproduce with:
E
E curl -X POST -H 'Content-Type: application/json' -d '{"token": ""}' http://localhost/api/token/verify
_____________________________ test_api[POST /api/token/pair] ______________________________
.venv/lib/python3.12/site-packages/schemathesis/_hypothesis.py:81: in test_api
def test_function(*args: Any, **kwargs: Any) -> Any:
tests/test_schemathesis/test_schema.py:15: in test_api
case.call_and_validate(base_url=str(live_server))
E schemathesis.exceptions.CheckFailed:
E
E 1. Undocumented HTTP status code
E
E Received: 400
E Documented: 200
E
E [400] Bad Request:
E
E `{"detail": "Invalid input.", "code": "invalid", "email": "email is required"}`
E
E Reproduce with:
E
E curl -X POST -H 'Content-Type: application/json' -d '{"email": "", "password": ""}' http://localhost/api/token/pair
tests/test_schemathesis/test_schema.py:15: in test_api
case.call_and_validate(base_url=str(live_server))
E schemathesis.exceptions.CheckFailed:
E
E 1. Response violates schema
E
E [{'type': 'value_error', 'loc': ['body', 'user_token'], 'msg': 'Value error, A string literal cannot contain NUL (0x00) characters.', 'ctx': {'error': 'A string literal cannot contain NUL (0x00) characters.'}}] is not of type 'string'
E
E Schema at /additionalProperties:
E
E {
E "type": "string"
E }
E
E Value:
E
E [
E {
E "type": "value_error",
E "loc": [
E "body",
E "user_token"
E ],
E "msg": "Value error, A string literal cannot contain NUL (0x00) chara...
E "ctx": {
E "error": "A string literal cannot contain NUL (0x00) characters."
E }
E }
E ]
E
E [422] Unprocessable Entity:
E
E `{"detail": [{"type": "value_error", "loc": ["body", "user_token"], "msg": "Value error, A string literal cannot contain NUL (0x00) characters.", "ctx": {"error": "A string literal cannot contain NUL (0x00) characters."}}]}`
E
E Reproduce with:
E
E curl -X POST -H 'Content-Type: application/json' -d '{"email": "\u0000", "password": "0"}' http://localhost/api/token/pair
I runned
schemathesis
ondjango-ninja-jwt
, it found several problems:Reproducer:
and a test case:
The text was updated successfully, but these errors were encountered: