Skip to content
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

ImageCreate error from generated client #5

Closed
youyuanwu opened this issue Apr 3, 2021 · 0 comments · Fixed by go-openapi/runtime#198
Closed

ImageCreate error from generated client #5

youyuanwu opened this issue Apr 3, 2021 · 0 comments · Fixed by go-openapi/runtime#198
Labels
bug Something isn't working

Comments

@youyuanwu
Copy link
Member

ImageCreate command is not working due to generated client code gives error:

(string) is not supported by the ByteStreamProducer, can be resolved by supporting Reader/BinaryMarshaler interface

This is not CLI generation problem.

Example Program that produces this:

package tests

import (
	"testing"

	"github.com/go-openapi/dockerctl/client"
	"github.com/go-openapi/dockerctl/client/image"
	httptransport "github.com/go-openapi/runtime/client"
	"github.com/go-openapi/strfmt"
)

func TestCreateImage(t *testing.T) {
	r := httptransport.New("localhost", client.DefaultBasePath, []string{"http"})

	appCli := client.New(r, strfmt.Default)

	_, err := appCli.Image.ImageCreate(image.NewImageCreateParams())

	if err != nil {
		// shows: Unexpected error:  (string) is not supported by the ByteStreamProducer, can be resolved by supporting Reader/BinaryMarshaler interface
		// but expect connection refused.
		t.Errorf("Unexpected error: %+v", err)
	}
}

I checked in this code in branch here: https://github.com/go-swagger/dockerctl/blob/ImageCreateError/tests/image_create_test.go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant