Open sonr09 opened 3 years ago
I've experienced the same problems. I'm wondering if it would be sufficient to rewrite code parts that contain hardcoded rest/api
such as
into
url = self.resource_url("content/{page_id}/child/{type}".format(page_id=page_id, type=type))
The resource_url
function is defined in as follows:
I also noticed that it's not only the confluence module that has the problem, but also others, e.g.
Also in the bitbucket module the logic looks differently and the string is hard coded depending on the url:
How is the general idea here? I could probably write a PR but would like to first understand how this should be implemented best. Maybe one of the maintainers of this package can help?
@dotcs thank you for comment.
I don't know cases that would be use api_root. I've just noted that api_root not used in confluence module and I've saw that confluence REST API has something which called context.
If somebody find cases for using api_root (especially in Confluence module), PR will have place.
I was also wondering about the construct in bitbucket. I think this is a difference between private cloud instances which use the rest/api
and the atlassian instance which use another server name.
Following REAS API doc: https://docs.atlassian.com/ConfluenceServer/rest/7.11.1/#api/content/{id}/child-childrenOfType Client can make requests with context and without: Example with context: http://example.com:8080/confluence/rest/api/space/ds Example without context: http://confluence.myhost.com:8095/rest/api/space/ds
Following code, I found that this is possible to define via arg api_root in parent for class Confluence. But this arg not used after that. So client can request only for hard coded api root = 'rest/api/'.
p.s. I have to idea why Atlassian provided requests with context and without :)