ctreminiom / go-atlassian

✨ Golang Client Library for Atlassian Cloud.
https://docs.go-atlassian.io
MIT License
131 stars 34 forks source link

Unable To Specify ParentID For Conf v2 POST Create Page #210

Open squatched opened 1 year ago

squatched commented 1 year ago

go-atlassian version Most Recent (v1.5.0)

go-atlassian component

Describe the bug :bug: This bug is a miss in that the request body to POST /wiki/api/v2/pages may include parentId but go-atlassian does not include it in models.PageCreatePayloadScheme.

To Reproduce :construction: Steps to reproduce the behavior:

  1. Create a new models.PageCreatePayloadScheme
  2. Observe no ParentID member.

Expected behavior :white_check_mark: A clear and concise description of what you expected to happen. Expected a ParentID member.

Screenshots :page_facing_up: 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/jira"
    "log"
    "os"
)

func main() {

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

    jiraCloud, err := jira.New(nil, host)
    if err != nil {
        return
    }

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

    // Steps to reproduce
    payload := &models.PageCreatePayloadScheme{
        SpaceID:  203718658,
        Status:   "current",
        Title:    "Page create title test",
        ParentID: 12345678,       // <- Compile error: "Unknown field 'ParentID' in struct literal"
    }
}