Comments (6)
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.
@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.
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.
This is wrong request, return 400
{
"parent": {
"type": "database_id",
"database_id": "abcd"
}
}
This is right request
{
"parent": {
"database_id": "abcd"
}
}
So, the type
is not optional.
from notionapi.
type
is required for parsing responses. For requests, you can leave this property empty and everything will be OK, right?
from notionapi.
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)
- Generate mock client? HOT 1
- Improve Comments & Documentation
- Add Read Support for Status Properties
- Missing parent field in Block interface
- unable to remove the value of select
- "This API is deprecated." When fetching a db with no id.
- Authentication Client does not work HOT 1
- unsupported property type: unique_id HOT 1
- Missing "after" param for Append block children endpoint
- Is SearchFilter necessary? HOT 1
- Common interface for Block, Page, and Database HOT 1
- Setters for Block interface HOT 1
- Interface to unify Pdf, FileBlock, Image
- Interface for getting RichText from various blocks HOT 1
- More straightforward way to get property IDs for database schema than duplicating repo code? HOT 3
- Validation error when trying to update an image block HOT 1
- Why isn't `BasicBlock` autofilled for each type?
- unsupported property type: button HOT 4
- Unset number property
- Option for choosing the Date format
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from notionapi.