Skip to content

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

Open
Omar-Tnt04 wants to merge 2 commits intotypicode: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 intotypicode: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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

unexpected output when using _embed with persons table

1 participant