Skip to content
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

Feature: RESTful Filter #2185

Closed
jim-parry opened this issue Sep 3, 2019 · 9 comments
Closed

Feature: RESTful Filter #2185

jim-parry opened this issue Sep 3, 2019 · 9 comments
Assignees
Labels
dev new feature PRs for new features

Comments

@jim-parry
Copy link
Contributor

Add a RESTful filter to handle data representation transformations for REST requests

@jim-parry jim-parry self-assigned this Sep 3, 2019
@jim-parry jim-parry added dev new feature PRs for new features labels Sep 3, 2019
@MGatner
Copy link
Member

MGatner commented Aug 25, 2020

According to Jim, the intent for this was "to automatically translate between JSON & XML data in & out." (#2165). Also "once i am done, we shouldn't need the formatter explicitly. The filter will be a before & after filter for a ResourceController" (Slack).

He doesn't appear to have done any work on it but it doesn't seem too complicated.

@lonnieezell
Copy link
Member

I'm curious how much people still use XML for their RESTful work. Seems like JSON has kind of won out. Tempted to close this since nothing is happening on it.

@MGatner
Copy link
Member

MGatner commented May 8, 2021

I think the Filter would still be desirable outside of the XML bit. I believe the intent was for it to handle all the negotiation and formatting so that wouldn't be a responsibility of the controller/trait.

That said, anecdotally I have yet to come across an XML API instance where I would have needed that feature.

@lonnieezell
Copy link
Member

@MGatner now that time has marched on, what are your thoughts on this?

Reading back through it, it strikes me as more magical than CI typically tries to be. Again, tempted to close. If people decide it's a worthy feature then a discussion or PR will show up, but I haven't seen anyone mention a need for this....

@MGatner
Copy link
Member

MGatner commented Jan 5, 2022

@lonnieezell The problem has always been the lack of expertise in this area, since Jim passed. We had a forum visitor with a lot of great advice but who couldn't implement the code - I offered to do the coding but it just hasn't happened yet. If anyone else wants to do the work, this thread and user seem to have what we need to proceed:

https://forum.codeigniter.com/thread-79278.html

@lonnieezell
Copy link
Member

I don't see what he was talking about having anything to do with this particular issue, though.

Regarding his post, my understanding was the PUT didn't allow for multipart/form inputs, but heading over to MDN tells me I seem to be wrong. Maybe that was just a typical use-case that I had learned in the day? Not sure, but his point has merit - we shouldn't restrict to POST for form validation/files, I guess. Needs more research, though.

@iRedds
Copy link
Collaborator

iRedds commented Jan 5, 2022

RESTful cannot be a filter. This should be the default work of the framework core.
But core is not ready for implementation right now.

@MGatner
Copy link
Member

MGatner commented Jan 6, 2022

🤷‍♂️ I dunno what to say mates. This is not my area but I've kept it alive based on multiple conversations with Jim and his insistence he had a solution in mind. The framework has revolved lots since then, maybe it isn't relevant anymore, or maybe nobody is using REST with CI4 these days.

I don't foresee more involvement with REST in my near future so if we just want to abandon this I have no issues.

@lonnieezell
Copy link
Member

I'm going to close this one. I think there's still areas around REST that can be improved. I don't think a filter to auto-convert the format of the data is one that's helpful. Maybe he had something in mind I can't see, but we'll never know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev new feature PRs for new features
Projects
None yet
Development

No branches or pull requests

4 participants