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

Add a flag to the entity generator to mark it as an API Platform resource #175

Closed
dunglas opened this issue May 5, 2018 · 1 comment
Closed

Comments

@dunglas
Copy link
Member

dunglas commented May 5, 2018

As an alternative to #158, what do you think about adding a new --api-platform-resource option to the entity generator that will automatically:

  • Add the @ApiResource annotation to the generated entity
  • Tell the user to run composer req api if API Platform isn't already installed
@nicolas-grekas
Copy link
Member

could we even name it --api-resource?

weaverryan added a commit that referenced this issue May 17, 2018
… make:entity command (dunglas)

This PR was squashed before being merged into the 1.0-dev branch (closes #178).

Discussion
----------

API Platform support: add an --api-resource flag for the make:entity command

This PR adds a new `--api-resource` flag to the `make:entity` command. It allows to automatically a REST endpoint with CRUD operations for the given resource class using API Platform:

![screencast](https://user-images.githubusercontent.com/57224/39909149-c6c386e6-54f1-11e8-83a2-bfcd10f5ed39.gif)

I need some guidance about how to add test for this (actually, a few tests are red locally on my Mac even on master).

Fixes #175.

Commits
-------

1c8cf9a Make the Generator class a service
3d2918a Add a functional test
e6ad344 Check if the class exists
ae7c296 Add an interactive question
37b3b9c API Platform support: add an --api-resource flag for the make:entity command
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

No branches or pull requests

2 participants