-
Notifications
You must be signed in to change notification settings - Fork 2k
feat: API transformers #9763
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: API transformers #9763
Conversation
e655300
to
10796a6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about the when
/ whenNot
methods - they don't seem to bring much value, since they're basically just short if
statement replacements. They could also be confusing at first glance because of our ConditionalTrait
. But that might just be a first impression.
Seems like Deptrac rules have to be updated.
Overall, this seems like a really useful feature for people who work with APIs often.
No, you're right I think. It's mainly syntactic sugar and not really necessary. I'll remove them for now. I even looked at our ConditionalTrait to see if we could use it and it wouldn't work nicely so it's probably just confusing. Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just reviewed on phone. I'll review again later but here are some comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Description
Adds API Transformers to CodeIgniter. This helps enforce best practices of never providing your entire object's values to the API. Instead, you would use a Transformer to build the API's response objects. This also allows:
Checklist: