Client
Client copied to clipboard
[5.0] [RFC] Design for version 5.0
Lessons learnt from earlier versions:
- ~Trying to support different versions of Guzzle and Buzz ourselves is a mess, and leads to bugs. We should instead use PSR-7/17/18 with PHP HTTP discovery (replaces #157, #245).~ Done in version 4.0.
- Entities are a bad idea. They are hard to keep updated and accurate, and frustrating for users. Plain arrays are fine, and the APIs are already documented by DO.
- Use links for pagination (replaces #7).
- We need to look over the all the latest APIs and implement them all, but not spaces (replaces #232).
- Builds URI using https://github.com/guzzle/uri-template to avoid errors
I've just done some work on v3, first, so that migrating from v2 -> v3 shouldn't be too jarring, and then v3 -> v4 will be even simpler. In particular, v3 now automatically discovers the available http clients (either Guzzle or Buzz) in much the same way v4 will. Now you just make a new digital ocean client, and away you go!
https://github.com/DigitalOceanPHP/Client/tree/3.0#examples
Something to consider @GrahamCampbell is that DigitalOcean are creating an OpenAPI spec for their API. This will make generating a PHP client a breeze (if it actually happens). See https://github.com/digitalocean/api-v2/issues/190
I've placed a comment to see what the progress is.
👋 Hey everyone, just wanted to share that we've open sourced our OpenAPI spec at https://github.com/digitalocean/openapi. It's in early access for now and will likely change some more before an official release, but it could be useful to test out client generation, if you're interested 🙂
This issue has been automatically marked as stale because there has been no recent activity. It will be closed after 30 days if no further activity occurs. Thank you for your contributions.
:wave:
This issue has been automatically marked as stale because there has been no recent activity. It will be closed after 30 days if no further activity occurs. Thank you for your contributions.