Skip to content

feat: add per-type API transformer sparse fieldsets - #10285

Merged
michalsn merged 2 commits into
codeigniter4:4.8from
michalsn:feat/api-transformer-sparse-fieldsets
Jun 12, 2026
Merged

feat: add per-type API transformer sparse fieldsets#10285
michalsn merged 2 commits into
codeigniter4:4.8from
michalsn:feat/api-transformer-sparse-fieldsets

Conversation

@michalsn

@michalsn michalsn commented Jun 7, 2026

Copy link
Copy Markdown
Member

Description
This PR adds per-type sparse fieldsets for API transformers via fields[<type>].

Transformers can opt in by defining $resourceType, allowing nested resources to apply their own field filters without inheriting the root fields parameter.

Ref: #10278 (comment)

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value (without duplication)
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@michalsn michalsn added enhancement PRs that improve existing functionalities 4.8 PRs that target the `4.8` branch. labels Jun 7, 2026
Comment thread system/API/BaseTransformer.php
Comment thread system/API/BaseTransformer.php
@michalsn
michalsn merged commit 0c5c3ad into codeigniter4:4.8 Jun 12, 2026
60 of 62 checks passed
@michalsn

Copy link
Copy Markdown
Member Author

Thank you for the reviews!

@michalsn
michalsn deleted the feat/api-transformer-sparse-fieldsets branch August 10, 2026 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4.8 PRs that target the `4.8` branch. enhancement PRs that improve existing functionalities

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants