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
565756e
Undid debug changes
WyriHaximus Jun 13, 2021
0dc825e
Fix schema references
WyriHaximus Jun 13, 2021
0bd8bc5
Testing something 8000
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
Adding type hinting to arrays
  • Loading branch information
WyriHaximus committed May 3, 2021
commit 481f1bbe5b09b57469757bf4ba5328f8c76e363c
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.

13 changes: 10 additions & 3 deletions src/OpenAPI/ApiGitHubCom/Schema/ActionsBillingUsage.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,19 @@
final class ActionsBillingUsage
{
public const SCHEMA_TITLE = 'actions-billing-usage';
public const SPL_HASH = '0000000054d5fa120000000071115dec';
public const SCHEMA_DESCRIPTION = '';
/**The sum of the free and paid GitHub Actions minutes used.**/
/**
* The sum of the free and paid GitHub Actions minutes used.
*/
private int $total_minutes_used;
/**The total paid GitHub Actions minutes used.**/
/**
* The total paid GitHub Actions minutes used.
*/
private int $total_paid_minutes_used;
/**The amount of free GitHub Actions minutes available.**/
/**
* The amount of free GitHub Actions minutes available.
*/
private int $included_minutes;
private object $minutes_used_breakdown;
public function total_minutes_used() : int
Expand Down
1 change: 1 addition & 0 deletions src/OpenAPI/ApiGitHubCom/Schema/ActionsEnabled.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
final class ActionsEnabled
{
public const SCHEMA_TITLE = 'actions-enabled';
public const SPL_HASH = '0000000054d5e7770000000071115dec';
public const SCHEMA_DESCRIPTION = 'Whether GitHub Actions is enabled on the repository.';
}
17 changes: 13 additions & 4 deletions src/OpenAPI/ApiGitHubCom/Schema/ActionsEnterprisePermissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,23 @@
final class ActionsEnterprisePermissions
{
public const SCHEMA_TITLE = 'actions-enterprise-permissions';
public const SPL_HASH = '0000000054d5faf70000000071115dec';
public const SCHEMA_DESCRIPTION = '';
/**The policy that controls the organizations in the enterprise that are allowed to run GitHub Actions. Can be one of: `all`, `none`, or `selected`.**/
/**
* The policy that controls the organizations in the enterprise that are allowed to run GitHub Actions. Can be one of: `all`, `none`, or `selected`.
*/
private string $enabled_organizations;
/**The API URL to use to get or set the selected organizations that are allowed to run GitHub Actions, when `enabled_organizations` is set to `selected`.**/
/**
* The API URL to use to get or set the selected organizations that are allowed to run GitHub Actions, when `enabled_organizations` is set to `selected`.
*/
private string $selected_organizations_url;
/**The permissions policy that controls the actions that are allowed to run. Can be one of: `all`, `local_only`, or `selected`.**/
/**
* The permissions policy that controls the actions that are allowed to run. Can be one of: `all`, `local_only`, or `selected`.
*/
private string $allowed_actions;
/**The API URL to use to get or set the actions that are allowed to run, when `allowed_actions` is set to `selected`.**/
/**
* The API URL to use to get or set the actions that are allowed to run, when `allowed_actions` is set to `selected`.
*/
private string $selected_actions_url;
public function enabled_organizations() : string
{
Expand Down
17 changes: 13 additions & 4 deletions src/OpenAPI/ApiGitHubCom/Schema/ActionsOrganizationPermissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,23 @@
final class ActionsOrganizationPermissions
{
public const SCHEMA_TITLE = 'actions-organization-permissions';
public const SPL_HASH = '0000000054d5f9fe0000000071115dec';
public const SCHEMA_DESCRIPTION = '';
/**The policy that controls the repositories in the organization that are allowed to run GitHub Actions. Can be one of: `all`, `none`, or `selected`.**/
/**
* The policy that controls the repositories in the organization that are allowed to run GitHub Actions. Can be one of: `all`, `none`, or `selected`.
*/
private string $enabled_repositories;
/**The API URL to use to get or set the selected repositories that are allowed to run GitHub Actions, when `enabled_repositories` is set to `selected`.**/
/**
* The API URL to use to get or set the selected repositories that are allowed to run GitHub Actions, when `enabled_repositories` is set to `selected`.
*/
private string $selected_repositories_url;
/**The permissions policy that controls the actions that are allowed to run. Can be one of: `all`, `local_only`, or `selected`.**/
/**
* The permissions policy that controls the actions that are allowed to run. Can be one of: `all`, `local_only`, or `selected`.
*/
private string $allowed_actions;
/**The API URL to use to get or set the actions that are allowed to run, when `allowed_actions` is set to `selected`.**/
/**
* The API URL to use to get or set the actions that are allowed to run, when `allowed_actions` is set to `selected`.
*/
private string $selected_actions_url;
public function enabled_repositories() : string
{
Expand Down
9 changes: 7 additions & 2 deletions src/OpenAPI/ApiGitHubCom/Schema/ActionsPublicKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@
final class ActionsPublicKey
{
public const SCHEMA_TITLE = 'ActionsPublicKey';
public const SPL_HASH = '0000000054d5f9d30000000071115dec';
public const SCHEMA_DESCRIPTION = 'The public key used for setting Actions Secrets.';
/**The identifier for the key.**/
/**
* The identifier for the key.
*/
private string $key_id;
/**The Base64 encoded public key.**/
/**
* The Base64 encoded public key.
*/
private string $key;
private int $id;
private string $url;
Expand Down
13 changes: 10 additions & 3 deletions src/OpenAPI/ApiGitHubCom/Schema/ActionsRepositoryPermissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,19 @@
final class ActionsRepositoryPermissions
{
public const SCHEMA_TITLE = 'actions-repository-permissions';
public const SPL_HASH = '0000000054d5e7760000000071115dec';
public const SCHEMA_DESCRIPTION = '';
/**Whether GitHub Actions is enabled on the repository.**/
/**
* Whether GitHub Actions is enabled on the repository.
*/
private boolean $enabled;
/**The permissions policy that controls the actions that are allowed to run. Can be one of: `all`, `local_only`, or `selected`.**/
/**
* The permissions policy that controls the actions that are allowed to run. Can be one of: `all`, `local_only`, or `selected`.
*/
private string $allowed_actions;
/**The API URL to use to get or set the actions that are allowed to run, when `allowed_actions` is set to `selected`.**/
/**
* The API URL to use to get or set the actions that are allowed to run, when `allowed_actions` is set to `selected`.
*/
private string $selected_actions_url;
public function enabled() : boolean
{
Expand Down
5 changes: 4 additions & 1 deletion src/OpenAPI/ApiGitHubCom/Schema/ActionsSecret.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
final class ActionsSecret
{
public const SCHEMA_TITLE = 'Actions Secret';
public const SPL_HASH = '0000000054d5e4eb0000000071115dec';
public const SCHEMA_DESCRIPTION = 'Set secrets for GitHub Actions.';
/**The name of the secret.**/
/**
* The name of the secret.
*/
private string $name;
private string $created_at;
private string $updated_at;
Expand Down
1 change: 1 addition & 0 deletions src/OpenAPI/ApiGitHubCom/Schema/Actor.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
final class Actor
{
public const SCHEMA_TITLE = 'Actor';
public const SPL_HASH = '0000000054d5fa020000000071115dec';
public const SCHEMA_DESCRIPTION = 'Actor';
private int $id;
private string $login;
Expand Down
1 change: 1 addition & 0 deletions src/OpenAPI/ApiGitHubCom/Schema/AlertCreatedAt.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
final class AlertCreatedAt
{
public const SCHEMA_TITLE = 'alert-created-at';
public const SPL_HASH = '0000000054d5e5550000000071115dec';
public const SCHEMA_DESCRIPTION = 'The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.';
}
1 change: 1 addition & 0 deletions src/OpenAPI/ApiGitHubCom/Schema/AlertHtmlUrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
final class AlertHtmlUrl
{
public const SCHEMA_TITLE = 'alert-html-url';
public const SPL_HASH = '0000000054d5e5530000000071115dec';
public const SCHEMA_DESCRIPTION = 'The GitHub URL of the alert resource.';
}
1 change: 1 addition & 0 deletions src/OpenAPI/ApiGitHubCom/Schema/AlertInstancesUrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
final class AlertInstancesUrl
{
public const SCHEMA_TITLE = 'alert-instances-url';
public const SPL_HASH = '0000000054d5e5520000000071115dec';
public const SCHEMA_DESCRIPTION = 'The REST API URL for fetching the list of instances for an alert.';
}
1 change: 1 addition & 0 deletions src/OpenAPI/ApiGitHubCom/Schema/AlertNumber.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
final class AlertNumber
{
public const SCHEMA_TITLE = 'alert-number';
public const SPL_HASH = '0000000054d5e5560000000071115dec';
public const SCHEMA_DESCRIPTION = 'The security alert number.';
}
1 change: 1 addition & 0 deletions src/OpenAPI/ApiGitHubCom/Schema/AlertUrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
final class AlertUrl
{
public const SCHEMA_TITLE = 'alert-url';
public const SPL_HASH = '0000000054d5e5540000000071115dec';
public const SCHEMA_DESCRIPTION = 'The REST API URL of the alert resource.';
}
1 change: 1 addition & 0 deletions src/OpenAPI/ApiGitHubCom/Schema/AllowedActions.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
final class AllowedActions
{
public const SCHEMA_TITLE = 'allowed-actions';
public const SPL_HASH = '0000000054d5fa890000000071115dec';
public const SCHEMA_DESCRIPTION = 'The permissions policy that controls the actions that are allowed to run. Can be one of: `all`, `local_only`, or `selected`.';
}
1 change: 1 addition & 0 deletions src/OpenAPI/ApiGitHubCom/Schema/ApiOverview.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
final class ApiOverview
{
public const SCHEMA_TITLE = 'Api Overview';
public const SPL_HASH = '0000000054d5f8340000000071115dec';
public const SCHEMA_DESCRIPTION = 'Api Overview';
private boolean $verifiable_password_authentication;
private object $ssh_key_fingerprints;
Expand Down
Loading
0