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

Stream pages in Notion source has incorrect schema for field properties #19777

Closed
grishick opened this issue Nov 23, 2022 · 0 comments · Fixed by #20639
Closed

Stream pages in Notion source has incorrect schema for field properties #19777

grishick opened this issue Nov 23, 2022 · 0 comments · Fixed by #20639
Assignees

Comments

@grishick
Copy link
Contributor

Stream pages has a field properties which is an array of objects. The objects are defined as oneOf and describes several types of objects that can appear inside properties array. One of these object variations can have 3 fields: id, type, and title defined as following:

{
									"type": "object",
									"properties": {
										"id": {
											"type": "string"
										},
										"type": {
											"enum": ["title"]
										},
										"title": {
											"properties": {
												"text": {
													"type": ["null", "array"],
													"items": {
														"type": ["null", "object"],
														"properties": {
															"href": {
																"type": ["null", "string"]
															},
															"text": {
																"type": ["null", "object"],
																"properties": {
																	"link": {
																		"type": ["null", "object"],
																		"properties": {
																			"url": {
																				"type": ["null", "string"]
																			},
																			"type": {
																				"enum": ["url"]
																			}
																		},
																		"additionalProperties": true
																	},
																	"content": {
																		"type": ["null", "string"]
																	}
																}
															},
															"type": {
																"type": ["null", "string"]
															},
															"plain_text": {
																"type": ["null", "string"]
															},
															"annotations": {
																"type": ["null", "object"],
																"properties": {
																	"bold": {
																		"type": ["null", "boolean"]
																	},
																	"code": {
																		"type": ["null", "boolean"]
																	},
																	"color": {
																		"type": ["null", "string"]
																	},
																	"italic": {
																		"type": ["null", "boolean"]
																	},
																	"underline": {
																		"type": ["null", "boolean"]
																	},
																	"strikethrough": {
																		"type": ["null", "boolean"]
																	}
																},
																"additionalProperties": true
															}
														},
														"additionalProperties": true
													}
												},
												"type": {
													"type": ["null", "string"]
												}
											}
										}
									}
								}

the bug in this schema definition is that the actual data looks like this, where title is an array of objects:

"properties": [{
			"name": "title",
			"value": {
				"id": "title",
				"type": "title",
				"title": [{
					"type": "text",
					"text": {
						"content": "blahblah",
						"link": null
					},
					"annotations": {
						"bold": false,
						"italic": false,
						"strikethrough": false,
						"underline": false,
						"code": false,
						"color": "default"
					},
					"plain_text": "blahblah",
					"href": null
				}]
			}
		}],
@davydov-d davydov-d self-assigned this Dec 19, 2022
@davydov-d davydov-d linked a pull request Dec 19, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants