Skip to content

fix(service): support _embed=person when the resource key is persons#1752

Open
Omar-Tnt04 wants to merge 2 commits into
typicode:mainfrom
Omar-Tnt04:fix-embed-person-persons
Open

fix(service): support _embed=person when the resource key is persons#1752
Omar-Tnt04 wants to merge 2 commits into
typicode:mainfrom
Omar-Tnt04:fix-embed-person-persons

Conversation

@Omar-Tnt04

Copy link
Copy Markdown
Contributor

Fixes #1634

Summary

Singular _embed lookups currently resolve related collections through inflection.pluralize().

That breaks cases like _embed=person when the resource key is persons, because inflection.pluralize('person') returns people, so the lookup misses and the relation is not embedded.

Reproduction

With:

{
  "persons": [
    { "id": "1", "name": "Tim" }
  ],
  "feedbacks": [
    { "id": "1", "personId": "1", "text": "Great dev" }
  ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant