Visitar URL original
fix: omit `included` member when not supported by grzuy · Pull Request #480 · beam-community/jsonapi · GitHub
Skip to content

fix: omit included member when not supported - #480

Open
grzuy wants to merge 1 commit into
beam-community:mainfrom
pdqcom:omit-included
Open

grzuy wants to merge 1 commit into
beam-community:mainfrom
pdqcom:omit-included

Conversation

@grzuy

@grzuy grzuy commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Hi 👋

For an API that does not even support compound documents, there's not way to get the included: [] omitted from all the JSON:API document responses.

Would it make sense to adjust this to just return the included member when is reasonable? That being:

  1. When there's compound resources to include in the response (client request or view default includes)
  2. When no compound resources but the client did requested include query param (so valuable for the client to see included: [])

Thanks!

@grzuy
grzuy requested a review from a team as a code owner November 6, 2026 13:55

@mattpolzin mattpolzin left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think your logic is reasonable as far as heuristic approaches to determining whether to serialize the included property go, but I also think that changing the behavior from “always serialize” to “sometimes serialize” could break clients that have been built around this library’s behavior (despite the JSON:API spec saying included is not a required property).

I think ultimately I’d vote to hate [EDIT] gate this behind a new configuration option just to be safe.

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.

2 participants