But if there's some field with default value in schema we get a semi-valid resource object { state: 0 } without ID. Then, on trying to create a self link system tries to get 'id' field on { state: 0 } and eventually produces AttributeError.
I think it should be fixed by skipping compute_schema and schema.dump in the ResourceDetail.get() method. As soon as it's clear that resource does not exist we may simply jump to after_get.
Hi, guys.
First of all, congrats on the fantastic library you've made. It's super cool.
I'm submitting a report on erroneous (from my POV) behavior. Here's STR:
Create a schema where at least one field has default value like this:
Create resource for that schema and route leading to it.
Try to fetch single resource by non-existing ID:
AR:
ER:
So, the problem is in that method ResourceDetail.get() after figuring out that there's no resource with provided ID still tries to built a result:
But if there's some field with default value in schema we get a semi-valid resource object { state: 0 } without ID. Then, on trying to create a self link system tries to get 'id' field on { state: 0 } and eventually produces AttributeError.
I think it should be fixed by skipping compute_schema and schema.dump in the ResourceDetail.get() method. As soon as it's clear that resource does not exist we may simply jump to after_get.
What do you think?