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

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

Open
headincl0ud opened this issue Oct 9, 2023 · 1 comment

Comments

@headincl0ud
Copy link
Contributor

headincl0ud commented Oct 9, 2023

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"`
@headincl0ud
Copy link
Contributor Author

PR: #60

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant