Repository: moby/moby (language: go)

Issue:
Swagger documentation for CreateImageInfo should contain errorDetail field
### Description

Currently the Create Image docker client operation can return a JSON structure such as the following on rare occasions, perhaps due to a transient network error:

```json
{"errorDetail":{"message":"Get \"[https://registry-1.docker.io/v2/localstack/localstack/manifests/sha256:d7aefdaae6712891f13795f538fd855fe4e5a8722249e9ca965e94b69b83b819\](https://registry-1.docker.io/v2/localstack/localstack/manifests/sha256:d7aefdaae6712891f13795f538fd855fe4e5a8722249e9ca965e94b69b83b819/)": EOF"},"error":"Get \"[https://registry-1.docker.io/v2/localstack/localstack/manifests/sha256:d7aefdaae6712891f13795f538fd855fe4e5a8722249e9ca965e94b69b83b819\](https://registry-1.docker.io/v2/localstack/localstack/manifests/sha256:d7aefdaae6712891f13795f538fd855fe4e5a8722249e9ca965e94b69b83b819/)": EOF"}
```

This causes issues with API clients such as [Bollard](https://github.com/fussybeaver/bollard) that expect a `CreateImageInfo` object as generated by the swagger API documentation:

https://github.com/moby/moby/blob/152467d185d4ae8748519025caf48b301cac7766/api/swagger.yaml#L2293-L2305

Issues in Bollard related to this: 
 - https://github.com/fussybeaver/bollard/issues/242
 - https://github.com/fussybeaver/bollard/issues/200

From what I can tell, the create image operation just uses a `streamformatter` to format errors, which itself has a standard `errorDetail` field.

https://github.com/moby/moby/blob/152467d185d4ae8748519025caf48b301cac7766/api/server/router/image/image_routes.go#L81
https://github.com/moby/moby/blob/152467d185d4ae8748519025caf48b301cac7766/pkg/streamformatter/streamformatter.go#L37
https://github.com/moby/moby/blob/152467d185d4ae8748519025caf48b301cac7766/pkg/jsonmessage/jsonmessage.go#L147

### Reproduce

Unable to reproduce.

### Expected behavior

The expected `CreateImageInfo` swagger documentation should have an `errorDetail` field.

### docker version

```bash
Client:
 Version:           20.10.17
 API version:       1.41
 Go version:        go1.18.3
 Git commit:        100c70180f
 Built:             Sat Jun 11 23:27:28 2022
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server:
 Engine:
  Version:          20.10.17
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.18.3
  Git commit:       a89b84221c
  Built:            Sat Jun 11 23:27:14 2022
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.6.6
  GitCommit:        10c12954828e7c7c9b6e0ea9b0c02b01407d3ae1.m
 runc:
  Version:          1.1.3
  GitCommit:        
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
```


### docker info

```bash
Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc., v0.8.2-docker)
  compose: Docker Compose (Docker Inc., 2.9.0)

Server:
 Containers: 2
  Running: 2
  Paused: 0
  Stopped: 0
 Images: 10
 Server Version: 20.10.17
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: false
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: active
  NodeID: usvdo5pr82y5qofwxpcd5gmxi
  Is Manager: true
  ClusterID: aty9vazysn5y0v0yc472gnboo
  Managers: 1
  Nodes: 1
  Default Address Pool: 10.0.0.0/8  
  SubnetSize: 24
  Data Path Port: 4789
  Orchestration:
   Task History Retention Limit: 5
  Raft:
   Snapshot Interval: 10000
   Number of Old Snapshots to Retain: 0
   Heartbeat Tick: 1
   Election Tick: 10
  Dispatcher:
   Heartbeat Period: 5 seconds
  CA Configuration:
   Expiry Duration: 3 months
   Force Rotate: 0
  Autolock Managers: false
  Root Rotation In Progress: false
  Node Address: 192.168.1.171
  Manager Addresses:
   192.168.1.171:2377
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 10c12954828e7c7c9b6e0ea9b0c02b01407d3ae1.m
 runc version: 
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
  cgroupns
 Kernel Version: 5.18.15-arch1-2
 Operating System: Arch Linux
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 15.56GiB
 Name: ragamuffin
 ID: LS6Y:UKUG:BDNN:CGV4:X6P6:M6WI:E5HM:R2J4:VG2M:B6AL:7UEZ:5Q7S
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false
```


### Additional Info

_No response_


Discussion / hints:

Fix patch:
diff --git a/api/swagger.yaml b/api/swagger.yaml
index 622441b26831a..9bc61c30ef060 100644
--- a/api/swagger.yaml
+++ b/api/swagger.yaml
@@ -2343,6 +2343,8 @@ definitions:
         type: "string"
       error:
         type: "string"
+      errorDetail:
+        $ref: "#/definitions/ErrorDetail"
       status:
         type: "string"
       progress:
diff --git a/docs/api/v1.42.yaml b/docs/api/v1.42.yaml
index 183c2fb7a7a01..14282cd8e6f71 100644
--- a/docs/api/v1.42.yaml
+++ b/docs/api/v1.42.yaml
@@ -2343,6 +2343,8 @@ definitions:
         type: "string"
       error:
         type: "string"
+      errorDetail:
+        $ref: "#/definitions/ErrorDetail"
       status:
         type: "string"
       progress:


Test patch: