api/types: migrate NetworkCreateResponse to network.CreateResponse

Migrate the type to the network package, and generate it from swagger.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2024-05-29 15:58:11 +02:00
parent 2ebf19129f
commit 89624e09e6
12 changed files with 61 additions and 30 deletions

View File

@@ -11,6 +11,7 @@ import (
"testing"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/network"
"github.com/docker/docker/errdefs"
"gotest.tools/v3/assert"
is "gotest.tools/v3/assert/cmp"
@@ -50,7 +51,7 @@ func TestNetworkCreate(t *testing.T) {
return nil, fmt.Errorf("expected POST method, got %s", req.Method)
}
content, err := json.Marshal(types.NetworkCreateResponse{
content, err := json.Marshal(network.CreateResponse{
ID: "network_id",
Warning: "warning",
})