go-sdk icon indicating copy to clipboard operation
go-sdk copied to clipboard

AdminCreateUser fails with json: cannot unmarshal array into Go value of type map[string]interface {}

Open klauern opened this issue 6 years ago • 5 comments

Similar to #40, I noticed this when trying to use this SDK to write a Terraform provider plugin.

package gitea

import (
	"fmt"
	"testing"

	"code.gitea.io/sdk/gitea"
)

func TestGiteaUserCreate(t *testing.T) {
	client := gitea.NewClient("http://localhost:3000", "978fd3ee4f71d6cf8a87556201d37293d719230d")
	user, err := client.AdminCreateUser(gitea.CreateUserOption{
		Email:     "[email protected]",
		LoginName: "random",
		Username:  "random",
	})

	if err != nil {
		t.Fatal(err)
	}

	fmt.Printf("%#v", user)

}

klauern avatar Nov 23 '17 14:11 klauern