DigitalOceanPHP / Client

DigitalOcean API v2 client for PHP
MIT License
710 stars 205 forks source link

[5.0] [RFC] Design for version 5.0 #249

Closed GrahamCampbell closed 1 year ago

GrahamCampbell commented 4 years ago

Lessons learnt from earlier versions:

  1. ~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.
  2. 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.
  3. Use links for pagination (replaces #7).
  4. We need to look over the all the latest APIs and implement them all, but not spaces (replaces #232).
  5. Builds URI using https://github.com/guzzle/uri-template to avoid errors
GrahamCampbell commented 4 years ago

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!

GrahamCampbell commented 4 years ago

https://github.com/DigitalOceanPHP/Client/tree/3.0#examples

glennjacobs commented 4 years ago

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.

bentranter commented 3 years ago

👋 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 🙂

stale[bot] commented 2 years ago

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.

GrahamCampbell commented 2 years ago

:wave:

stale[bot] commented 1 year ago

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.