brands = {
"item_title": "brand",
"schema": {
"name": {"type": "string"},
"address": "string",
}
}
components = {
"item_title": "component",
"schema": {
"name": {"type": "string"},
"price": "integer",
"brand": {"type": "objectid", "data_relation": {"resource": "brands"}},
}
}
computers = {
"item_title": "computers",
"schema": {
"name": {"type": "string"},
"components": {
"type": "dict",
"schema": {
"cpu": {"type": "objectid", "data_relation": {"resource": "components"}},
"motherboard": {"type": "objectid", "data_relation": {"resource": "components"}},
}
}
}
}
-------------------------------------------------- Captured log call --------------------------------------------------
ERROR eve:app.py:1891 Exception on /computers/5f8e82e3b51714d566994c13/ [GET]
Traceback (most recent call last):
File "c:\dev\github\eve\env\lib\site-packages\flask\app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "c:\dev\github\eve\env\lib\site-packages\flask\app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "c:\dev\github\eve\env\lib\site-packages\flask\app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "c:\dev\github\eve\env\lib\site-packages\flask\_compat.py", line 39, in reraise
raise value
File "c:\dev\github\eve\env\lib\site-packages\flask\app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "c:\dev\github\eve\env\lib\site-packages\flask\app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "C:\dev\github\eve\eve\endpoints.py", line 94, in item_endpoint
response = getitem(resource, **lookup)
File "C:\dev\github\eve\eve\methods\common.py", line 325, in rate_limited
return f(*args, **kwargs)
File "C:\dev\github\eve\eve\auth.py", line 80, in decorated
return f(*args, **kwargs)
File "C:\dev\github\eve\eve\methods\common.py", line 1369, in decorated
r = f(resource, **combined_args)
File "C:\dev\github\eve\eve\methods\get.py", line 321, in getitem
return getitem_internal(resource, **lookup)
File "C:\dev\github\eve\eve\methods\get.py", line 414, in getitem_internal
build_response_document(document, resource, embedded_fields, latest_doc)
File "C:\dev\github\eve\eve\methods\common.py", line 673, in build_response_document
resolve_embedded_documents(document, resource, embedded_fields)
File "C:\dev\github\eve\eve\methods\common.py", line 1110, in resolve_embedded_documents
for subdocument in subdocuments(fields_chain[:-1], resource, document):
File "C:\dev\github\eve\eve\methods\common.py", line 1066, in subdocuments
for result in subdocuments(fields_chain[1:], resource, doc):
File "C:\dev\github\eve\eve\methods\common.py", line 1059, in subdocuments
resource = field_definition(resource, fields_chain[0])["data_relation"][
TypeError: 'NoneType' object is not subscriptable
Expected Behavior
Using following schemas:
Making the following request:
/computers/5f8e82e3b51714d566994c13?embedded={"components.cpu": 1, "components.motherboard": 1, "components.cpu.brand": 1, "components.motherboard.brand": 1} [GET]Should provide results with embedded documents
Actual Behavior
Error is raised:
Environment