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

Open
opened 2018-12-17 14:22:43 +00:00 by JonasFranz · 0 comments
Owner

Author: @klauern Posted at: 23.11.2017 14:30

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:     "random@example.com",
		LoginName: "random",
		Username:  "random",
	})

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

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

}
Author: @klauern Posted at: 23.11.2017 14:30 <!-- 1. Please speak English, this is the language all of us can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/NsatcWJ) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> Similar to #40, I noticed this when trying to use this SDK to write a [Terraform](https://terraform.io) provider plugin. ```go 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: "random@example.com", LoginName: "random", Username: "random", }) if err != nil { t.Fatal(err) } fmt.Printf("%#v", user) } ```
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: JonasFranz/go-sdk#77
No description provided.