8000 Openapi based client proof of concept by WyriHaximus · Pull Request #78 · php-api-clients/github · GitHub
[go: up one dir, main page]

Skip to content

Openapi based client proof of concept #78

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

Open
wants to merge 108 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
a7a879e
Openapi based client proof of concept
WyriHaximus Apr 28, 2021
799858f
Drop dependancies for now
WyriHaximus Apr 30, 2021
6fe9bde
Ignore some things
WyriHaximus May 1, 2021
8c0ad54
Add all avialable API version
WyriHaximus May 1, 2021
21f3fb9
Prefix versions with v
WyriHaximus May 1, 2021
ca0fb8a
Add mocked webhooks (It's crappy but it's a start)
WyriHaximus May 1, 2021
481f1bb
Adding type hinting to arrays
WyriHaximus May 3, 2021
d6f1a75
Typed properties :D
WyriHaximus May 3, 2021
43a122b
Nullable all the thigns!
WyriHaximus May 3, 2021
5cb409f
Simplefied webhooks for now
WyriHaximus May 3, 2021
a18a296
Gah
WyriHaximus May 3, 2021
1c5439f
wafefaeafew
WyriHaximus May 3, 2021
bf7c125
asdfads
WyriHaximus May 3, 2021
42d5d22
Deal with weird property naming
WyriHaximus May 3, 2021
06d504d
Plus and minus signs...
WyriHaximus May 3, 2021
38599e4
Dashes in class names
WyriHaximus May 3, 2021
2c8476c
Annotations!
WyriHaximus May 8, 2021
ea235f7
object => array
WyriHaximus May 9, 2021
2434152
GHES 3.1
WyriHaximus May 27, 2021
2333e9a
Drop double \ in some namespaces
WyriHaximus May 27, 2021
a2d23ed
Add "official" webhooks
WyriHaximus May 29, 2021
bbfa1f0
Applied code style rules
WyriHaximus May 29, 2021
2f6ce40
Update QA config
WyriHaximus May 29, 2021
4de94b6
Better object detection
WyriHaximus May 29, 2021
18efccd
Added nested schema objects
WyriHaximus May 29, 2021
ec9e725
Several improvements
WyriHaximus May 29, 2021
e930c5e
No nullables
WyriHaximus May 29, 2021
ee08ad3
Correctly set no default value for non-array objects
WyriHaximus May 29, 2021
4b1632a
Fixed certain annotations and dropped GHE as a test
WyriHaximus May 30, 2021
08ab22d
Fixes! And dropped code style for now because it seem to have some we…
WyriHaximus May 30, 2021
de9805e
Keeping it slim for now
WyriHaximus May 30, 2021
f267946
Handle null values better
WyriHaximus Jun 6, 2021
429fbb1
Better webhooks support
WyriHaximus Jun 8, 2021
fba8b3e
Keeping it slim for now
WyriHaximus Jun 8, 2021
3539ea9
Webhook Interface
WyriHaximus Jun 9, 2021
1486257
Ensure we have the webhook interface as return types for from WebHook…
WyriHaximus Jun 9, 2021
7e01de2
updated dependencies
WyriHaximus Jun 12, 2021
d50cfb6
Limited allOf support
WyriHaximus Jun 13, 2021
e5d0760
Temporary new CS rules applied until the fixes stop breaking the code
WyriHaximus Jun 13, 2021
f01aca7
Some fixes
WyriHaximus Jun 13, 2021
f1414c7
Testing something
WyriHaximus Jun 13, 2021
e55ee42
Nope
WyriHaximus Jun 13, 2021
d574f3e
Debug
WyriHaximus Jun 13, 2021
bdb5d82
Trying something else
WyriHaximus Jun 13, 2021
4e089d1
Another thing
WyriHaximus Jun 13, 2021
10000
565756e
Undid debug changes
WyriHaximus Jun 13, 2021
0dc825e
Fix schema references
WyriHaximus Jun 13, 2021
0bd8bc5
Testing something
WyriHaximus Jun 13, 2021
d68b87e
Nullable
WyriHaximus Jun 13, 2021
c440f03
More improvements!
WyriHaximus Jun 14, 2021
25499e9
Merge remote-tracking branch 'origin/openapi-based-client-proof-of-co…
WyriHaximus Jun 14, 2021
f161e69
Phew
WyriHaximus Jun 14, 2021
56b24dd
Improvements!
WyriHaximus Jun 14, 2021
ead61d3
Support nullable flag
WyriHaximus Jun 14, 2021
258c31a
Make merged nullable for now by hand due to schema inaccuracy
WyriHaximus Jun 27, 2021
0f991df
Make mergeable_state nullable for now by hand due to schame inacuracy
WyriHaximus Jun 27, 2021
7c7b907
Updated generated code
WyriHaximus Jul 18, 2021
7cb11e7
TEst
WyriHaximus Jul 18, 2021
cbd9fd4
test
WyriHaximus Jul 18, 2021
e5d61fa
Node code
WyriHaximus Jul 18, 2021
9943d57
Test
WyriHaximus Jul 18, 2021
6483228
Test
WyriHaximus Jul 18, 2021
74fb551
Test
WyriHaximus Jul 18, 2021
327ff34
Ugh
WyriHaximus Jul 22, 2021
0ae4ff2
Oops
WyriHaximus Jul 22, 2021
27af82c
Grrr
WyriHaximus Jul 22, 2021
89a859f
Improved webhook handling
WyriHaximus Aug 7, 2021
d9ce079
Added missing single use webhooks
WyriHaximus Aug 8, 2021
cb586ea
Unlock PHP 8
WyriHaximus Sep 11, 2021
a0f652f
Update dependencies
WyriHaximus Sep 11, 2021
3aa1741
New WebHooks schema from cebe/openapi
WyriHaximus Feb 7, 2022
50a4696
Abd composer.json changes
WyriHaximus Feb 7, 2022
81acb34
MVP support for oneOf schema's
WyriHaximus Feb 10, 2022
60b206e
Translate number to int
WyriHaximus Feb 10, 2022
0f2934b
WebHooks have names again :tada: !
WyriHaximus Feb 10, 2022
43ac5de
Ship new client wiring update
WyriHaximus Jun 3, 2022
da6c01f
Removed trailing ? from URL's without a query
WyriHaximus Jun 4, 2022
e8455ea
Update to new webvsocket including OpenAPI spec
WyriHaximus Dec 11, 2022
0682150
Update to latest generated client bringing all schemas and making req…
WyriHaximus Dec 24, 2022
eb292aa
More predictable naming
WyriHaximus Jan 4, 2023
56cd733
Drop CHE and CHAE and in time put them in their own packages
WyriHaximus Jan 4, 2023
cd49a14
Added nested unknown schemas
WyriHaximus Jan 4, 2023
3f3c394
Better nullable types
WyriHaximus Jan 4, 2023
d05bed8
Better naming conventions
WyriHaximus Jan 4, 2023
358343c
Make the browser required
WyriHaximus Jan 5, 2023
54030ef
Add authentication
WyriHaximus Jan 5, 2023
fb03405
Better naming for all classes
WyriHaximus Jan 6, 2023
3a4d5dd
Several upgrades
WyriHaximus Jan 12, 2023
2a35781
Handle empry response bodies a little bit better
WyriHaximus Jan 13, 2023
fc29f2f
Reserved keywords fix
WyriHaximus Jan 17, 2023
588c6d2
Fix webhook key issues
WyriHaximus Jan 17, 2023
ccd87dd
Use eventsauce/object-hydrator for object hydration
WyriHaximus Jan 29, 2023
bd9d138
Hydrate WebHooks
WyriHaximus Jan 30, 2023
fb7bf78
Small fixes
WyriHaximus Jan 30, 2023
6aee035
Add ClientIntface
WyriHaximus Jan 30, 2023
6829fe2
Fibers
WyriHaximus Feb 1, 2023
8d0b426
PHPStan understands these return conditionals
WyriHaximus Feb 2, 2023
479aa3c
Hydrator templates
WyriHaximus Feb 3, 2023
5929af2
Hydrator rename so it's easier to used externally
WyriHaximus Feb 3, 2023
ddfd693
Hydrator template fixes
WyriHaximus Feb 4, 2023
93352c3
Re-fixed nested schemas
WyriHaximus Feb 5, 2023
bf29b8b
Correct constructor types
WyriHaximus Feb 5, 2023
abd4b48
Add example values to schema
WyriHaximus Feb 6, 2023
b1f9b51
Next gen generated client
WyriHaximus Feb 18, 2023
ca00ff0
Getting there :D!
WyriHaximus Feb 22, 2023
23cff8d
Contracts
WyriHaximus Feb 22, 2023
d1dc962
Getting there
WyriHaximus Feb 23, 2023
9451e3e
Hydrator shizzle
WyriHaximus Feb 25, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Prev Previous commit
Next Next commit
Several improvements
  • Loading branch information
WyriHaximus committed May 29, 2021
commit ec9e725c56a3e478c1cfc9fc1f63ff7fac4f10cf
The diff you're trying to view is too large. We only load the first 3000 changed files.
20 changes: 10 additions & 10 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions src/OpenAPI/ApiGitHubCom/Path.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

declare(strict_types=1);

namespace ApiClients\Client\Github\OpenAPI\ApiGitHubCom;

use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\Meta\Root;

final class Path
{
function get(): Root
{
return new Root();
}
}
6 changes: 3 additions & 3 deletions src/OpenAPI/ApiGitHubCom/Path/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

namespace ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Path;

use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\Apps\GetAuthenticatedOperation;
use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\Apps\GetAuthenticated;

final class App
{
function get(): GetAuthenticatedOperation
function get(): GetAuthenticated
{
return new GetAuthenticatedOperation();
return new GetAuthenticated();
}
}
12 changes: 6 additions & 6 deletions src/OpenAPI/ApiGitHubCom/Path/App/Hook/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@

namespace ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Path\App\Hook;

use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\Apps\GetWebhookConfigForAppOperation;
use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\Apps\UpdateWebhookConfigForAppOperation;
use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\Apps\GetWebhookConfigForApp;
use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\Apps\UpdateWebhookConfigForApp;

final class Config
{
function get(): GetWebhookConfigForAppOperation
function get(): GetWebhookConfigForApp
{
return new GetWebhookConfigForAppOperation();
return new GetWebhookConfigForApp();
}

function patch(): UpdateWebhookConfigForAppOperation
function patch(): UpdateWebhookConfigForApp
{
return new UpdateWebhookConfigForAppOperation();
return new UpdateWebhookConfigForApp();
}
}
6 changes: 3 additions & 3 deletions src/OpenAPI/ApiGitHubCom/Path/App/Installations.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

namespace ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Path\App;

use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\Apps\ListInstallationsOperation;
use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\Apps\ListInstallations;

final class Installations
{
function get(int $per_page = 30, int $page = 1, $since, $outdated): ListInstallationsOperation
function get(int $per_page = 30, int $page = 1, $since, $outdated): ListInstallations
{
return new ListInstallationsOperation($per_page, $page, $since, $outdated);
return new ListInstallations($per_page, $page, $since, $outdated);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@

namespace ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Path\App\Installations;

use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\Apps\DeleteInstallationOperation;
use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\Apps\GetInstallationOperation;
use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\Apps\DeleteInstallation;
use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\Apps\GetInstallation;

final class CbInstallationIdRcb
{
function get($installation_id): GetInstallationOperation
function get($installation_id): GetInstallation
{
return new GetInstallationOperation($installation_id);
return new GetInstallation($installation_id);
}

function delete($installation_id): DeleteInstallationOperation
function delete($installation_id): DeleteInstallation
{
return new DeleteInstallationOperation($installation_id);
return new DeleteInstallation($installation_id);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

namespace ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Path\App\Installations\CbInstallationIdRcb;

use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\Apps\CreateInstallationAccessTokenOperation;
use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\Apps\CreateInstallationAccessToken;

final class AccessTokens
{
function post($installation_id): CreateInstallationAccessTokenOperation
function post($installation_id): CreateInstallationAccessToken
{
return new CreateInstallationAccessTokenOperation($installation_id);
return new CreateInstallationAccessToken($installation_id);
}
}
F438
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@

namespace ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Path\App\Installations\CbInstallationIdRcb;

use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\Apps\SuspendInstallationOperation;
use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\Apps\UnsuspendInstallationOperation;
use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\Apps\SuspendInstallation;
use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\Apps\UnsuspendInstallation;

final class Suspended
{
function put($installation_id): SuspendInstallationOperation
function put($installation_id): SuspendInstallation
{
return new SuspendInstallationOperation($installation_id);
return new SuspendInstallation($installation_id);
}

function delete($installation_id): UnsuspendInstallationOperation
function delete($installation_id): UnsuspendInstallation
{
return new UnsuspendInstallationOperation($installation_id);
return new UnsuspendInstallation($installation_id);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

namespace ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Path\AppManifests\CbCodeRcb;

use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\Apps\CreateFromManifestOperation;
use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\Apps\CreateFromManifest;

final class Conversions
{
function post($code): CreateFromManifestOperation
function post($code): CreateFromManifest
{
return new CreateFromManifestOperation($code);
return new CreateFromManifest($code);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

namespace ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Path\Applications\CbClientIdRcb;

use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\Apps\DeleteAuthorizationOperation;
use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\Apps\DeleteAuthorization;

final class Grant
{
function delete($client_id): DeleteAuthorizationOperation
function delete($client_id): DeleteAuthorization
{
return new DeleteAuthorizationOperation($client_id);
return new DeleteAuthorization($client_id);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

namespace ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Path\Applications\CbClientIdRcb\Grants;

use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\Apps\RevokeGrantForApplicationOperation;
use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\Apps\RevokeGrantForApplication;

final class CbAccessTokenRcb
{
function delete($client_id, $access_token): RevokeGrantForApplicationOperation
function delete($client_id, $access_token): RevokeGrantForApplication
{
return new RevokeGrantForApplicationOperation($client_id, $access_token);
return new RevokeGrantForApplication($client_id, $access_token);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@

namespace ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Path\Applications\CbClientIdRcb;

use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\Apps\CheckTokenOperation;
use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\Apps\DeleteTokenOperation;
use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\Apps\ResetTokenOperation;
use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\Apps\CheckToken;
use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\Apps\DeleteToken;
use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\Apps\ResetToken;

final class Token
{
function post($client_id): CheckTokenOperation
function post($client_id): CheckToken
{
return new CheckTokenOperation($client_id);
return new CheckToken($client_id);
}

function delete($client_id): DeleteTokenOperation
function delete($client_id): DeleteToken
{
return new DeleteTokenOperation($client_id);
return new DeleteToken($client_id);
}

function patch($client_id): ResetTokenOperation
function patch($client_id): ResetToken
{
return new ResetTokenOperation($client_id);
return new ResetToken($client_id);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

namespace ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Path\Applications\CbClientIdRcb\Token;

use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\Apps\ScopeTokenOperation;
use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\Apps\ScopeToken;

final class Scoped
{
function post($client_id): ScopeTokenOperation
function post($client_id): ScopeToken
{
return new ScopeTokenOperation($client_id);
return new ScopeToken($client_id);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@

namespace ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Path\Applications\CbClientIdRcb\Tokens;

use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\Apps\CheckAuthorizationOperation;
use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\Apps\ResetAuthorizationOperation;
use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\Apps\RevokeAuthorizationForApplicationOperation;
use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\Apps\CheckAuthorization;
use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\Apps\ResetAuthorization;
use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\Apps\RevokeAuthorizationForApplication;

final class CbAccessTokenRcb
{
function get($client_id, $access_token): CheckAuthorizationOperation
function get($client_id, $access_token): CheckAuthorization
{
return new CheckAuthorizationOperation($client_id, $access_token);
return new CheckAuthorization($client_id, $access_token);
}

function post($client_id, $access_token): ResetAuthorizationOperation
function post($client_id, $access_token): ResetAuthorization
{
return new ResetAuthorizationOperation($client_id, $access_token);
return new ResetAuthorization($client_id, $access_token);
}

function delete($client_id, $access_token): RevokeAuthorizationForApplicationOperation
function delete($client_id, $access_token): RevokeAuthorizationForApplication
{
return new RevokeAuthorizationForApplicationOperation($client_id, $access_token);
return new RevokeAuthorizationForApplication($client_id, $access_token);
}
}
6 changes: 3 additions & 3 deletions src/OpenAPI/ApiGitHubCom/Path/Applications/Grants.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

namespace ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Path\Applications;

use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\OauthAuthorizations\ListGrantsOperation;
use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\OauthAuthorizations\ListGrants;

final class Grants
{
function get(int $per_page = 30, int $page = 1, $client_id): ListGrantsOperation
function get(int $per_page = 30, int $page = 1, $client_id): ListGrants
{
return new ListGrantsOperation($per_page, $page, $client_id);
return new ListGrants($per_page, $page, $client_id);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@

namespace ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Path\Applications\Grants;

use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\OauthAuthorizations\DeleteGrantOperation;
use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\OauthAuthorizations\GetGrantOperation;
use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\OauthAuthorizations\DeleteGrant;
use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\OauthAuthorizations\GetGrant;

final class CbGrantIdRcb
{
function get($grant_id): GetGrantOperation
function get($grant_id): GetGrant
{
return new GetGrantOperation($grant_id);
return new GetGrant($grant_id);
}

function delete($grant_id): DeleteGrantOperation
function delete($grant_id): DeleteGrant
{
return new DeleteGrantOperation($grant_id);
return new DeleteGrant($grant_id);
}
}
6 changes: 3 additions & 3 deletions src/OpenAPI/ApiGitHubCom/Path/Apps/CbAppSlugRcb.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

namespace ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Path\Apps;

use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\Apps\GetBySlugOperation;
use ApiClients\Client\Github\OpenAPI\ApiGitHubCom\Operation\Apps\GetBySlug;

final class CbAppSlugRcb
{
function get($app_slug): GetBySlugOperation
function get($app_slug): GetBySlug
{
return new GetBySlugOperation($app_slug);
return new GetBySlug($app_slug);
}
}
Loading
0