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

Null Metadata Field Causing Confluence 500 Internal Service Error #64

Open
dimaliok opened this issue Oct 31, 2024 · 1 comment
Open

Comments

@dimaliok
Copy link

Describe the bug
When updating a page using the UpdateContent() function, with content.MetaData unset, Confluence returns a 500 Internal Service Error with the following message in debug mode:
{"statusCode":500,"message":"java.lang.NullPointerException: Cannot invoke \"java.util.Map.size()\" because \"<parameter1>\" is null"}

Looking at the outputted request json, I see a "metadata":null field. It appears the confluence API doesn't handle null fields well, so there should probably be an "omitempty" in the Metadata struct.
To Reproduce
Steps to reproduce the behavior:
Send a curl request to the confluence api with the metadata field being null. Or use UpdateContent with the metadata field unset.

Expected behavior
Update to be successful instead of returning a 500 error.

Release version
1.4.6

Additional context
Possibly related to #59

@dimaliok
Copy link
Author

Just wanted to add that a workaround is to set content.MetaData to an empty struct: content.Metadata = &goconfluence.Metadata{}

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