Steps to reproduce -
def update_with_attachment(page, space, version):
data = {
"type": "page",
"title": title,
"id": page,
"space": {"key": space},
"body": {
"storage": {
"value": '<ac:image><ri:attachment ri:filename="image.png">\n</ri:attachment></ac:image>',
"representation": "storage"
}
},
"version": {"number": version}
}
response = requests.put(url, json=data, auth=auth)
Expected result -
A 200 Response
Actual result -
com.atlassian.confluence.api.service.exceptions.InternalServerException: java.lang.RuntimeException: com.atlassian.confluence.content.render.xhtml.storage.resource.identifiers.StorageUnmarshalXhtmlException: java.lang.UnsupportedOperationException
Workaround:
Remove the newline character from
<ri:attachment ri:filename="image.png">\n</ri:attachment>