Skip to content

Metadata properties are responding with 500 Internal Errors during ContentUpload #59

@headincl0ud

Description

@headincl0ud

Describe the bug

Issued code: https://github.com/Virtomize/confluence-go-api/blob/master/content.go#L39
Metadata properties are responding with 500 Internal Errors.
With the implementation of Metadata, Confluence is continuously returning 500 errors.

To Reproduce
Let's try to configure Metadata in the following way:

		Metadata: &goconfluence.Metadata{
			Properties: &goconfluence.Properties{
				ContentAppearanceDraft: &goconfluence.ContentAppearanceDraft{
					Value: "full-width",
				},
				ContentAppearancePublished: &goconfluence.ContentAppearancePublished{
					Value: "full-width",
				},
			},
		},

Expected behavior
The operation - UploadContent should be completed successfully.
The Content should be uploaded the response code should be 200 and the layout should be configured for "full-width".

Release version
v1.4.4

Additional context
Found open-source references:
// Commented because Confluence was returned:
// '{"statusCode":500,"message":"java.lang.NullPointerException: null"}'

Solution
I found the solution to fix the issue with these 500 errors.
Based on community comments:
https://community.developer.atlassian.com/t/make-layout-full-width-when-creating-page/40461/3
The editor property should be not included in the request.

Even if this property isn't configured, go-confluence is attaching this field with the value: none
The solution is to omit/remove this parameter in the request.

Remove -> https://github.com/Virtomize/confluence-go-api/blob/master/content.go#L45
and run the above configuration again to resolve the issue and receive a 200 status code from Confluence.

or:
Fix it modifying:

	Editor                     *Editor                     `json:"editor,omitempty"`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions