William Cheng 22ac8faec7
Revert "[GO][Client] return GenericOpenAPIError instead of error in Execute() (#8137)" (#8427)
This reverts commit 1562afea3980484a7f1819c4f51b0d53a44a009f.
2021-01-14 13:59:21 +08:00

29 lines
735 B
Go

package main
import (
"context"
"testing"
sw "./go-petstore"
)
// TestPutBodyWithFileSchema ensures a model with the name 'File'
// gets converted properly to the petstore.File struct vs. *os.File
// as specified in typeMapping for 'File'.
func TestPutBodyWithFileSchema(t *testing.T) {
return // early return to test compilation
schema := sw.FileSchemaTestClass{
File: &sw.File{SourceURI: sw.PtrString("https://example.com/image.png")},
Files: &[]sw.File{{SourceURI: sw.PtrString("https://example.com/image.png")}}}
r, err := client.FakeApi.TestBodyWithFileSchema(context.Background()).Body(schema).Execute()
if err != nil {
t.Fatalf("Error while adding pet: %v", err)
}
if r.StatusCode != 200 {
t.Log(r)
}
}