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
{{ message }}
Repository navigation
Responses with wrong field types are coerced instead of rejected #339
Problem
When a 200 response does not match the documented shape, the client converts values instead of raising an error. Examples we reproduced against a stub server:
Response body
Result
check → {"allowed": "false"}
allowed is True
check → {"allowed": 1}
allowed is True
check → 200 with a body that is not JSON
allowed is False, no error
list_objects → {"objects": "doc:1"}
returns the characters of the string as objects
A real OpenFGA server does not send these bodies, but a proxy or faulty server in front of it can. For an authorization client, treating "false" as allowed is a fail-open result.
Expected
A 200 response whose fields do not have the documented types (e.g. allowed is not a boolean, objects is not a list of strings, the body is not JSON) raises a validation error instead of returning a value.
Activity