Closed mosheduminer closed 3 years ago
I should change it to throw a more meaningful error message, but you have to register all models in the API manager. Otherwise there are no endpoints created, and if there are no endpoints, there is nothing to point the link at
You're right of course.
What actually happened was that I was getting an error about there being no attribute "id" on my entity, and when I tried to reproduce, I didn't realized the error changed.
In short, the APIManager.create_api_blueprint
method assumes that the primary key is "id", and needs to be told otherwise explicitly, which I did not do. I think I only got the error when using include_links, because passed primarykey to the serializer, so the line `id = str(getattr(instance, self._primary_key))did not error, but the line
instance_id = getattr(instance, self._api_manager.primary_key_for(self._model))`.
I think everything is working now. Thank you for your time :+1:.
When creating an APIManager with
include_links=True
, an exception is thrown trying to access the endpoint:Reproduction test case: