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

Nested number/bullet list combination ends up with error #15

Open
KarolNov opened this issue Dec 21, 2021 · 2 comments
Open

Nested number/bullet list combination ends up with error #15

KarolNov opened this issue Dec 21, 2021 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@KarolNov
Copy link

KarolNov commented Dec 21, 2021

Discuss in #public-issue-15--nested-numberbullet-list-combination-ends-up-with-error

I've a deeply nested list items in my .md file, like this:

1. **Something important**

    1. Sub step one
        - something to remember
        - parameters: 
          - param 1
          - param 2
          - param 3

This formats correctly in GH:

  1. Something important

    1. Sub step one
      • something to remember
      • parameters:
        • param 1
        • param 2
        • param 3

but when converted to blocks and pushed as children element in the Notion API call I get error:
'{"object":"error","status":400,"code":"validation_error","message":"body failed validation: body.children[1].numbered_list_item.children[0].numbered_list_item.children[0].numbered_list_item.children should be not present, instead was `[{\\"object\\":\\"block\\",\\"type\\":\\"bulleted_list_item\\",\\"bullete...`."}'.
I tried recreating that styling manually in Notion and it seems to work.

@marissamarym
Copy link
Contributor

thanks for submitting this! we're looking into it

@marissamarym marissamarym added the bug Something isn't working label Dec 21, 2021
@EndBug EndBug self-assigned this Apr 13, 2022
@EndBug
Copy link
Member

EndBug commented Apr 13, 2022

Hi, thanks for submitting the issue. I've looked into this and I can reproduce the problem, but it seems it's a limitation imposed by Notion: the block structure is correct, but they allow only up to two levels of nesting in a single request when appending block children.
Related docs: https://developers.notion.com/reference/patch-block-children

If that's the cause of your issue, then I assume you'd have to wait for the first request to be fulfilled, grab the resulting IDs, and then append the "deeply nested" children.
It seems like the only alternative would be flattening the list, but that kind of defeats the purpose of having nested children...

What do you think @marissamarym?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants