jfinkels / flask-restless

NO LONGER MAINTAINED - A Flask extension for creating simple ReSTful JSON APIs from SQLAlchemy models.
https://flask-restless.readthedocs.io
GNU Affero General Public License v3.0
1.02k stars 301 forks source link

Duplicate rows in many-to-many relationship are only returned as a single result #662

Open caderitter opened 7 years ago

caderitter commented 7 years ago

Wanted to start by saying, wow, this extension is great. Props to the creators! 😄

I have a use case where a transaction has items. The Transaction table and the Item table are linked by a many-to-many relationship using a linking table. I want my JSON to return a transaction object with child object items. The issue arises when I have multiple of the same item on the same transaction. The API only returns one item even though there are two entries in the linking table. I didn't think this would be expected behavior.