svix / svix-webhooks

The enterprise-ready webhooks service 🦀
https://www.svix.com
MIT License
2.42k stars 167 forks source link

[0.5] Add OpenAPI spec to PHP Library #33

Open svix-frank opened 3 years ago

tasn commented 3 years ago

One small nitpick for this and #34: add OpenAPI code generation, or maybe just "Add code to interact with the Svix API". Feel free to ignore me 😂

svix-frank commented 3 years ago

@svix-yair I pushed a branch with the initial PHP generation here: https://github.com/svix/svix-libs/pull/150/commits There are 3 commits:

  1. move the webhook library from php/src to php/lib (better lines up with the openapi generator)
  2. the code required to generate the PHP bindings
  3. checking in all the bindings, since PHP is not compiled and composer just essentially clones your repo (no build step as far as I know) we have to check them in :cry:. I did it in a separate commit though so you can see what changes were made to generate the bindings and you can easily trash it if you need to make changes to the binding generation.

LMK if you have any questions or need a hand with any of it :smiley:. Note we use PSR-4 autoloading to make it easily compatible with composer projects. Which means you have to follow these rules for file and class naming: https://www.php-fig.org/psr/psr-4/