Dapplo.Confluence icon indicating copy to clipboard operation
Dapplo.Confluence copied to clipboard

Get root pages

Open Morhpeuss opened this issue 2 years ago • 3 comments

I want to get pages hierarchy in space. Root pages/page first with the children.

I am able to get children of the page, but how could I get the root pages?

Thanks. Josef

Morhpeuss avatar Feb 27 '23 20:02 Morhpeuss

I found the problem.

The right way is to use "confluenceClient.Space.GetContentsAsync(this.spaceKey)" but You need to add the query parameter "depth", regarding documentation https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-space/#api-wiki-rest-api-space-spacekey-content-type-get

How could I add the query parameter?

Morhpeuss avatar Feb 28 '23 09:02 Morhpeuss

Currently there is no way to specify the depth, I made this library with a "I/we will add it when it's needed" policy, and not trying to support everything if it's not needed. This request aligns with #62, where the start and limit are not supplied and aren't supported in the method call.

It makes sense to add support to something like query parameters with some defaults and optional, tailored to the request, depth would be in there. This would mean Space.GetContentsAsync would get another overload with an additional parameter.

Lakritzator avatar Mar 06 '23 09:03 Lakritzator

@Lakritzator I understand that you can not support all properties.

Adding a new overload of the method with optional parameters makes sense.

Morhpeuss avatar Mar 09 '23 11:03 Morhpeuss