-
Notifications
You must be signed in to change notification settings - Fork 1
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
Create a Rest Controller scaffold command. #57
Comments
👍 I dig the idea. |
What are next steps? |
@danielbachhuber We should decide whether this should go into the existing, bundled scaffold command (alongside CPTs, taxonomies, etc...), or whether this should be a separate command that you can optionally install. Given that this is an integral part of WordPress Core and that it seems to get more and more important for normal WP development, I'd go with a PR against |
I agree with this. @BE-Webdesign Can you share your proposed output for the routes? |
I would have to think a bit about it first. I can make a gist. |
https://gist.github.com/BE-Webdesign/42df5e6117659b7bb8b5066ab4f1c90a This would be a rough thing, I guess. It's not the full picture. |
Ideally, it'd be functional code. What do you think about scaffolding individual routes instead, with command arguments for each of the features that |
That would probably be a better starting place, then we could create the controller scaffolding based on those outputs. |
Hi Folks!
The scaffold commands are really invaluable, and I was wondering if wp-cli could feature a scaffolding command for creating REST API controllers. For the most part controllers are just massive boilerplate (which is good), and I think it would be great to have a wp-cli command to generate that boilerplate. It could by default output routes for EDITABLE, DELETABLE, CREATABLE, and READABLE. Then in one of the flags you could override that to only get what you need. I would be willing to help create these commands, but would first like to know more about the WP CLI process.
Thank you, wp-cli rocks!
The text was updated successfully, but these errors were encountered: