You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are several obstacles that make it impossible to have PHP support at the moment.
PHP codegen fails due to numerous issues with proto2 syntax. (I'm guessing buf fixed proto2 generation, because base protoc-gen-php didn't support proto2 altogether) At the moment those are:
Can't generate PHP code for closed enum buf.validate.Ignore. Please use either proto3 or editions without ``enum_type = CLOSED``. Even if I don't use protovalidate, I need to at least generate protovalidate metadata classes just to generate my regular proto bindings for PHP that have protovalidate options. For that to happen, I had to remove all enum uses in protovalidate
optional is not supported either, I had to delete all the optionals, too
protovalidate is fully based on CEL, which is not available in PHP
If PHP gains CEL support at some point, it's not impossible to add PHP support. A while ago, we've made a fork of protoc-gen-validate that generated yaml config for Symfony Validator which we'd been successfully using to this day.
We are now moving away to use protovalidate as a go interceptor put before our PHP backends, so we don't have to validate on PHP side, but it would be great to at least improve codegen.
Considering that
bufbuild
supports the generation for PHP, it would be useful to be able to use validations.The text was updated successfully, but these errors were encountered: