Skip to content

Commit 05f509d

Browse files
committed
feat: update docker api spec to v1.51 add validation to jane config
1 parent b4518bb commit 05f509d

File tree

573 files changed

+35479
-3255
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

573 files changed

+35479
-3255
lines changed

.jane-openapi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
declare(strict_types=1);
33

44
return [
5-
'openapi-file' => __DIR__ . '/spec/docker-v1.48-patched.yaml',
5+
'openapi-file' => __DIR__ . '/spec/docker-v1.51-patched.yaml',
66
'namespace' => 'WebProject\DockerApi\Library\Generated',
77
'directory' => __DIR__ . '/generated',
88
'strict' => true,
@@ -11,5 +11,5 @@ return [
1111
'clean-generated' => true,
1212
'reference' => true,
1313
'use-cacheable-supports-method' => true,
14-
'validation' => false,
14+
'validation' => true,
1515
];

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# php-docker-api-client - A PHP docker API client
22

33

4-
## Based on Docker API Version spec [docker-v1.48.yaml](spec/docker-v1.48.yaml)
5-
> patched types from real world [docker-v1.48-patched.yaml](spec/docker-v1.48-patched.yaml) responses and minor code patches (WIP)
4+
## Based on Docker API Version spec [docker-v1.51.yaml](spec/docker-v1.51.yaml)
5+
> converted to openapi v3.1.0 [docker-v1.51-patched.yaml](spec/docker-v1.51-patched.yaml) see [UPDATE.md](spec/UPDATE.md) how to upgrade client
66
77
## Example
88
```shell

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
}
4747
},
4848
"scripts": {
49-
"generate": "XDEBUG_MODE=off jane-openapi generate"
49+
"generate": "XDEBUG_MODE=off jane-openapi generate",
50+
"tests": "vendor/bin/codecept run"
5051
}
5152
}

generated/Client.php

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,9 +1116,13 @@ public function imageTag(string $name, array $queryParameters = [], string $fetc
11161116
* @param string $name Image name or ID
11171117
* @param array $queryParameters {
11181118
*
1119-
* @var bool $force Remove the image even if it is being used by stopped containers or has other tags
1120-
* @var bool $noprune Do not delete untagged parent images
1121-
* }
1119+
* @var bool $force Remove the image even if it is being used by stopped containers or has other tags
1120+
* @var bool $noprune Do not delete untagged parent images
1121+
* @var array $platforms Select platform-specific content to delete.
1122+
* Multiple values are accepted.
1123+
* Each platform is a OCI platform encoded as a JSON string.
1124+
*
1125+
* }
11221126
*
11231127
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
11241128
*
@@ -1353,13 +1357,9 @@ public function systemDataUsage(array $queryParameters = [], string $fetch = sel
13531357
*
13541358
* ### Image tarball format
13551359
*
1356-
* An image tarball contains one directory per image layer (named using its long ID), each containing these files:
1357-
*
1358-
* - `VERSION`: currently `1.0` - the file format version
1359-
* - `json`: detailed layer information, similar to `docker inspect layer_id`
1360-
* - `layer.tar`: A tarfile containing the filesystem changes in this layer
1360+
* An image tarball contains [Content as defined in the OCI Image Layout Specification](https://github.com/opencontainers/image-spec/blob/v1.1.1/image-layout.md#content).
13611361
*
1362-
* The `layer.tar` file contains `aufs` style `.wh..wh.aufs` files and directories for storing attribute changes and deletions.
1362+
* Additionally, includes the manifest.json file associated with a backwards compatible docker save format.
13631363
*
13641364
* If the tarball defines a repository, the tarball should also include a `repositories` file at the root that contains a list of repository and tag names mapped to layer IDs.
13651365
*
@@ -1406,8 +1406,15 @@ public function imageGet(string $name, array $queryParameters = [], string $fetc
14061406
*
14071407
* @param array $queryParameters {
14081408
*
1409-
* @var array $names Image names to filter by
1410-
* }
1409+
* @var array $names Image names to filter by
1410+
* @var string $platform JSON encoded OCI platform describing a platform which will be used
1411+
* to select a platform-specific image to be saved if the image is
1412+
* multi-platform.
1413+
* If not provided, the full multi-platform image will be saved.
1414+
*
1415+
* Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}`
1416+
*
1417+
* }
14111418
*
14121419
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
14131420
*
@@ -2735,7 +2742,7 @@ public static function create($httpClient = null, array $additionalPlugins = [],
27352742
if (null === $httpClient) {
27362743
$httpClient = \Http\Discovery\Psr18ClientDiscovery::find();
27372744
$plugins = [];
2738-
$uri = \Http\Discovery\Psr17FactoryDiscovery::findUriFactory()->createUri('/v1.48');
2745+
$uri = \Http\Discovery\Psr17FactoryDiscovery::findUriFactory()->createUri('/v1.51');
27392746
$plugins[] = new \Http\Client\Common\Plugin\AddPathPlugin($uri);
27402747
if (count($additionalPlugins) > 0) {
27412748
$plugins = array_merge($plugins, $additionalPlugins);

generated/Endpoint/ConfigDelete.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $re
5050
$status = $response->getStatusCode();
5151
$body = (string) $response->getBody();
5252
if (204 === $status) {
53+
return null;
5354
}
5455
if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) {
5556
throw new \WebProject\DockerApi\Library\Generated\Exception\ConfigDeleteNotFoundException($serializer->deserialize($body, 'WebProject\DockerApi\Library\Generated\Model\ErrorResponse', 'json'), $response);

generated/Endpoint/ConfigUpdate.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $re
8686
$status = $response->getStatusCode();
8787
$body = (string) $response->getBody();
8888
if (200 === $status) {
89+
return null;
8990
}
9091
if ((null === $contentType) === false && (400 === $status && false !== mb_strpos($contentType, 'application/json'))) {
9192
throw new \WebProject\DockerApi\Library\Generated\Exception\ConfigUpdateBadRequestException($serializer->deserialize($body, 'WebProject\DockerApi\Library\Generated\Model\ErrorResponse', 'json'), $response);

generated/Endpoint/ContainerArchive.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $re
7474
$status = $response->getStatusCode();
7575
$body = (string) $response->getBody();
7676
if (200 === $status) {
77+
return null;
7778
}
7879
if (400 === $status) {
7980
}

generated/Endpoint/ContainerArchiveInfo.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $re
7878
$status = $response->getStatusCode();
7979
$body = (string) $response->getBody();
8080
if (200 === $status) {
81+
return null;
8182
}
8283
if ((null === $contentType) === false && (400 === $status && false !== mb_strpos($contentType, 'application/json'))) {
8384
throw new \WebProject\DockerApi\Library\Generated\Exception\ContainerArchiveInfoBadRequestException($serializer->deserialize($body, 'WebProject\DockerApi\Library\Generated\Model\ErrorResponse', 'json'), $response);

generated/Endpoint/ContainerAttach.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,10 @@ protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $re
186186
$status = $response->getStatusCode();
187187
$body = (string) $response->getBody();
188188
if (101 === $status) {
189+
return null;
189190
}
190191
if (200 === $status) {
192+
return null;
191193
}
192194
if (400 === $status) {
193195
}

generated/Endpoint/ContainerAttachWebsocket.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,10 @@ protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $re
8686
$status = $response->getStatusCode();
8787
$body = (string) $response->getBody();
8888
if (101 === $status) {
89+
return null;
8990
}
9091
if (200 === $status) {
92+
return null;
9193
}
9294
if ((null === $contentType) === false && (400 === $status && false !== mb_strpos($contentType, 'application/json'))) {
9395
throw new \WebProject\DockerApi\Library\Generated\Exception\ContainerAttachWebsocketBadRequestException($serializer->deserialize($body, 'WebProject\DockerApi\Library\Generated\Model\ErrorResponse', 'json'), $response);

0 commit comments

Comments
 (0)