https://cerbos.dev logo
#community
Title
# community
y

Yousef Sultan

06/29/2023, 9:32 AM
What's the point of JSON resource schemas if, if the resource is shape is malformed, the request will be denied either way?
I'm meaning if I don't have a resource schema and the object I passed is not what I designed the conditions for, then the conditions will fail anyways and thus the request will be denied
c

Charith (Cerbos)

06/29/2023, 9:40 AM
Schemas help make sure that your application doesn't send the wrong data type for fields and include all the required fields needed by the rules. Depending on how you write your rules, they could still evaluate to true even if some are missing or of the wrong type. Having a schema ensures that doesn't happen.
y

Yousef Sultan

06/29/2023, 9:43 AM
Hmm, so so long I am using a `EFFECT_ALLOW`s I will basically be safe without schemas? I mean a non-provided
R.attr.someBool
will never evaluate to
true
nor
false
, right?
I also feel like I'd rather have TypeScript types code generated than have to write JSON schemas
It shouldn't be too hard to parse
conditions
to come up with the data structure required
3 Views