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

Confluence V2 API Space Get Returns Strings For IDs #240

Closed
1 of 5 tasks
squatched opened this issue Aug 29, 2023 · 0 comments · Fixed by #241
Closed
1 of 5 tasks

Confluence V2 API Space Get Returns Strings For IDs #240

squatched opened this issue Aug 29, 2023 · 0 comments · Fixed by #241
Assignees
Labels
bug Something isn't working

Comments

@squatched
Copy link
Contributor

go-atlassian version

go-atlassian component

  • Jira Software Cloud
  • Jira Agile Cloud
  • Jira Service Management Cloud
  • Confluence Cloud
  • Atlassian Admin Cloud

Describe the bug 🐛
image
SpaceSchemeV2 has id and homepageId as int types. This causes JSON unmarshaling errors when attempting to use SpaceV2Connector.Get().

Sample error:

error json: cannot unmarshal string into Go struct field SpaceSchemeV2.homepageId of type int, response code 200, and response {"authorId":"<snip>","homepageId":"<snip>","icon":null,"name":"<snip>","key":"<snip>","id":"<snip>","type":"personal","status":"current","createdAt":"<snip>","description":{"plain":{"value":"","representation":"plain"}}}

To Reproduce 🚧
Steps to reproduce the behavior:
Call SpaceV2Connector.Get().

Expected behavior
A clear and concise description of what you expected to happen.
I expected no errors when calling this with valid parameters.

Screenshots 📄
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Code snippet

package main

import (
	"context"
	"github.com/ctreminiom/go-atlassian/confluence/v2"
	"log"
	"os"
)

func main() {

	var (
		host  = os.Getenv("HOST")
		mail  = os.Getenv("MAIL")
		token = os.Getenv("TOKEN")
		spaceID = os.Getenv("CONFLUENCE_SPACE_ID")
	)

	confluenceCloud, err := v2.New(nil, host)
	if err != nil {
		return
	}

	confluenceCloud.Auth.SetBasicAuth(mail, token)
	confluenceCloud.Auth.SetUserAgent("curl/7.54.0")

	// Steps to reproduce
	confluenceCloud.Space.Get(context.TODO(), spaceID, "plain")
}
@squatched squatched added the bug Something isn't working label Aug 29, 2023
ctreminiom added a commit that referenced this issue Sep 22, 2023
Fix Issue #240: Adjust SpaceSchemeV2 `id` & `homepageID` Types
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.

2 participants