Describe the feature
Context
Today, I wrote this:
private function instancesToDelete($tags) {
return $this->rds->describeDBInstances(['Tags' => $tags])
}
This almost got me to delete production DBs by accident: Tags is completely ignored by RdsClient#describeDBInstances().
/cc @MarcoStagno @albertomolinari
The current API "documentation"
This proposal is about documenting clear array shapes for each API endpoint.
Currently, most API endpoints are documented as:
/**
* @method \Aws\Result describeDBInstances(array $args = [])
*/
It suffices to say that this is absolutely useless rubbish.
The proposal
The generated API documentation should change, and become:
/**
* @method \Aws\Result<list<array{
* foo: detailed-type-of-foo,
* bar: detailed-type-type-of-bar
* }>> describeDBInstances(array{
* baz?: detailed-type-of-baz,
* taz?: detailed-rtype-of-taz
* } $args = [])
*/
This is actually useful, self-documenting, and helpful for static analysis tooling (Psalm, PHPStan, Mago, Phan).
Use Case
This feature removes the need for jumping around web documentation when using the AWS SDK.
Proposed Solution
The code generator should convert documented types that are used under the hood into PHP types:
- arrays
- lists
- non-empty-lists
- string
- non-empty-string
- int
- int<1, max>
- etc.
Other Information
No response
Acknowledgements
SDK version used
3.379.0
Environment details (Version of PHP (php -v)? OS name and version, etc.)
PHP 8.4
Describe the feature
Context
Today, I wrote this:
This almost got me to delete production DBs by accident:
Tagsis completely ignored byRdsClient#describeDBInstances()./cc @MarcoStagno @albertomolinari
The current API "documentation"
This proposal is about documenting clear array shapes for each API endpoint.
Currently, most API endpoints are documented as:
It suffices to say that this is absolutely useless rubbish.
The proposal
The generated API documentation should change, and become:
This is actually useful, self-documenting, and helpful for static analysis tooling (Psalm, PHPStan, Mago, Phan).
Use Case
This feature removes the need for jumping around web documentation when using the AWS SDK.
Proposed Solution
The code generator should convert documented types that are used under the hood into PHP types:
Other Information
No response
Acknowledgements
SDK version used
3.379.0
Environment details (Version of PHP (
php -v)? OS name and version, etc.)PHP 8.4