Giter VIP home page Giter VIP logo

Comments (6)

jomei avatar jomei commented on September 7, 2024

Hey, @vaayne !
I didn't catch the point of this issue.
current Parent struct is

type Parent struct {
	Type       ParentType `json:"type,omitempty"`
	PageID     PageID     `json:"page_id,omitempty"`
	DatabaseID DatabaseID `json:"database_id,omitempty"`
}

so you can easily omit any of provided fields. If you don't need the type property in your request, just left it empty.

Could you provide more information about this problem?

from notionapi.

vaayne avatar vaayne commented on September 7, 2024

@jomei I think it is Notion's bug.

https://developers.notion.com/reference/post-page
The example is different from the struct. And the one in example worked.

from notionapi.

jomei avatar jomei commented on September 7, 2024

Still don't understand.
Could you please provide an example of a valid request or response that doesn't cover by current structure?

from notionapi.

vaayne avatar vaayne commented on September 7, 2024

This is wrong request, return 400

{
    "parent": {
        "type": "database_id",
        "database_id": "abcd"
    }
}

image

This is right request

{
    "parent": {
        "database_id": "abcd"
    }
}

image

So, the type is not optional.

from notionapi.

jomei avatar jomei commented on September 7, 2024

type is required for parsing responses. For requests, you can leave this property empty and everything will be OK, right?

from notionapi.

vaayne avatar vaayne commented on September 7, 2024

type is required for parsing responses. For requests, you can leave this property empty and everything will be OK, right?

Right.

from notionapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.