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 Request] PHP Support #168

Open
rpecb opened this issue Feb 14, 2024 · 1 comment
Open

[Feature Request] PHP Support #168

rpecb opened this issue Feb 14, 2024 · 1 comment
Labels
Language Support Interest in adding support for another language

Comments

@rpecb
Copy link

rpecb commented Feb 14, 2024

Considering that bufbuild supports the generation for PHP, it would be useful to be able to use validations.

@rpecb rpecb added the Feature New feature or request label Feb 14, 2024
@rodaine rodaine added Language Support Interest in adding support for another language and removed Feature New feature or request labels Feb 16, 2024
@rauanmayemir
Copy link

There are several obstacles that make it impossible to have PHP support at the moment.

  1. 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
  1. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Language Support Interest in adding support for another language
Projects
None yet
Development

No branches or pull requests

3 participants