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
[RFC] PHP based configuration #3558
Comments
Somehow related: symfony/symfony#36778 |
+1 on my side to have a PHP configuration. The metadata subsystem already allows to plug any source of configuration, so it should not be too hard. I agree with @alanpoulain, it must be consistent with what Symfony provides. @Grafikart are you using PHPStorm? Is yes, the PHP Annotations plugin will enable auto completion for almost everything. As we provide XSDs, autocompletion should also work with XML config file (but TBH I’ve not tested). |
@dunglas I'm using PHPStorm and it offers autocompletion for top level property but doesn't work for parameters for operations for instance. Also I couldn't figure out how to use constant for the security is_granted. /**
* itemOperations={
*. "get"={???},
* "post"={"normalization_context"=???}
* }
**/ It's easy to mix up normalizationContext and normalization_context and with annotation you have no feedback for this kind of typo :( I'm not a fan of the symfony suggestion since it's not easy to know what options are available. But It could work since it could be decorated easily. |
I would love this feature also. API Platform metadata is too powerful (and thus, complex) to fit nicely into annotations (and I normally LOVE annotations). I also just replied to a user on SymfonyCasts that loves API Platform, but dislikes the annotations. Getting this BEST "syntax" of a config system is the problem. If someone has some time to work on it, I would be very happy with an "first try" imperfect system. Once we have that, I have no doubt that the community will start iterating on it to improve it. But we need that first version! Cheers! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Its easier in 3.0 closing this for now |
Description
I like using ApiPlatform but I find the configuration painfull to set up (lack of autocompletion, no reusability, no automation, break easily without usefull warning...).
Being able to configure API platform using simple PHP class would solve these problems.
Example
This approach solve many problems I have with the configuration right now :
The text was updated successfully, but these errors were encountered: