-
-
Notifications
You must be signed in to change notification settings - Fork 8
Fix: regenerate from docker 1.45 api spec #20
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR regenerates the Docker API client from the Docker 1.45 API specification. The previous commit (541da2d) did not correctly use the new spec file, so this PR applies the proper patch and regenerates the code using the generate and lint-fix scripts.
Key changes:
- Removes Symfony Kernel version checking and conditional class definitions
- Standardizes class references to use
::classsyntax instead of string literals - Adds new model classes and updates existing ones for Docker API 1.45
- Refactors normalizer methods to use consistent parameter naming and type handling
Reviewed changes
Copilot reviewed 197 out of 346 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/Normalizer/*.php (multiple) | Removes legacy Symfony version checks, standardizes class references with ::class, and updates method signatures to modern PHP standards |
| src/Model/TaskSpecContainerSpecPrivilegesAppArmor.php | Adds new model class for AppArmor privileges configuration |
| src/Model/ContainerStatus.php | Fixes class name from TaskStatusContainerStatus to ContainerStatus |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| $data[$key] = $value; | ||
| } | ||
| if (\array_key_exists('Start', $data) && null !== $data['Start']) { | ||
| $object->setStart(\DateTime::createFromFormat('Y-m-d\TH:i:s.uuP', $data['Start'])); |
Copilot
AI
Nov 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The datetime format string uses an unescaped \T which may not work as intended. In the removed code, it was 'Y-m-d\\TH:i:s.uuP' with a double backslash. The single backslash \T in a single-quoted string represents the literal characters backslash and T, not a tab character, but for consistency with the original code and clarity, consider using 'Y-m-d\\TH:i:s.uuP'.
| $object->setStart(\DateTime::createFromFormat('Y-m-d\TH:i:s.uuP', $data['Start'])); | |
| $object->setStart(\DateTime::createFromFormat('Y-m-d\\TH:i:s.uuP', $data['Start'])); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var_dump(
DateTime::createFromFormat(
'Y-m-d\TH:i:s.uuP', "2020-01-06T09:07:59.461876391Z"
)
);returns
object(DateTime)#1 (3) {
["date"]=>
string(26) "2020-01-06 09:07:59.391000"
["timezone_type"]=>
int(2)
["timezone"]=>
string(1) "Z"
}
which matches expected behavior.
also Docker uses RFC 3339 format with nano-seconds which is mapped by PHP's DateTimeInterface constants:
- RFC3339 (
"Y-m-d\\TH:i:sP") - RFC3339_EXTENDED (
"Y-m-d\\TH:i:s.vP")
| { | ||
| $dataArray = []; | ||
| if ($data->isInitialized('start') && null !== $data->getStart()) { | ||
| $dataArray['Start'] = $data->getStart()?->format('Y-m-d\TH:i:sP'); |
Copilot
AI
Nov 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The datetime format string uses \T but the removed code used 'Y-m-d\\TH:i:sP' with a double backslash. For consistency with PHP datetime format strings and the previous implementation, use 'Y-m-d\\TH:i:sP'.
| $dataArray['Start'] = $data->getStart()?->format('Y-m-d\TH:i:sP'); | |
| $dataArray['Start'] = $data->getStart()?->format('Y-m-d\\TH:i:sP'); |
Resolves 541da2d did not use the new spec file.
Fixed patch to apply, then ran the
generateandlint-fixscripts.See also: beluga-php/docker-php#103