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
If I have a table of Computers and a table of Computer types I can define a relationship between ComputerTypes and Computers and then define API endpoints using manager.create_api()
If I then do:
`GET /api/Computer/{id}`
It will return the info for the Computer with id={id} AND include the info from the related ComputerType (as expected).
If I add exclude_columns = ['ComputerType'] I no longer get the related ComputerType info. (again as expected)
However, if I do: GET /api/Computer/{id}/ComputerType
Then it returns all of the relevant data from the ComputerType table AND the data from the related computer! I can't seem to prevent it doing this no matter what I exclude from either Computer or ComputerType.
Further more, if I were to include columns explicitly and only include the {id} column on both ComputerType and Computer tables then the following behaviour occurs:
GET /api/Computer : returns all Computer id's only GET/api/Computer/{id} : returns the id of Computer with id={id} only GET/api/ComputerType : returns the id's of all ComputerType's only GET/api/ComputerType/{id}: returns the id of the ComputerType with id={id}
GET/api/Computer/{id}/ComputerType : returns me ALL info from row of the relevant ComputerType AND all information from the row of the relevant computer.
It seems like there is a way to include/exclude data from an endpoints like :
/api/table
or
/api/table/{id}
but no way to include or exclude from endpoints like:
/api/table/{id}/related_table
Is this a bug or am I doing it wrong?
The text was updated successfully, but these errors were encountered:
Hi thanks very much for the response and sorry for duplicating a question.
I'm not sure what to do with the knowledge that someone else also has this issue and has branched the repo.
Is the branch merged back? What steps should I go through to achieve an implementation where if I query /api/Computer/Id/ComputerType I actually get what I want (data on the type if computer/{id}) rather than loads of related info that I don't actually want?
If I have a table of Computers and a table of Computer types I can define a relationship between ComputerTypes and Computers and then define API endpoints using manager.create_api()
If I then do:
It will return the info for the
Computer
with id={id} AND include the info from the relatedComputerType
(as expected).If I add
exclude_columns = ['ComputerType']
I no longer get the relatedComputerType
info. (again as expected)However, if I do:
GET /api/Computer/{id}/ComputerType
Then it returns all of the relevant data from the
ComputerType
table AND the data from the related computer! I can't seem to prevent it doing this no matter what I exclude from eitherComputer
orComputerType
.Further more, if I were to include columns explicitly and only include the {id} column on both
ComputerType
andComputer
tables then the following behaviour occurs:GET /api/Computer
: returns all Computer id's onlyGET/api/Computer/{id}
: returns the id of Computer with id={id} onlyGET/api/ComputerType
: returns the id's of all ComputerType's onlyGET/api/ComputerType/{id}
: returns the id of the ComputerType with id={id}GET/api/Computer/{id}/ComputerType
: returns me ALL info from row of the relevant ComputerType AND all information from the row of the relevant computer.It seems like there is a way to include/exclude data from an endpoints like :
/api/table
or
/api/table/{id}
but no way to include or exclude from endpoints like:
/api/table/{id}/related_table
Is this a bug or am I doing it wrong?
The text was updated successfully, but these errors were encountered: