Description
Describe the bug
Trying to create a page with a Select property causes the following error:
Notion.Client.NotionApiException: body failed validation. Fix one: body.properties.Status.select.color should be `"default"`, `"gray"`, `"brown"`, `"orange"`, `"yellow"`, `"green"`, `"blue"`, `"purple"`, `"pink"`, `"red"`, or `undefined`, instead was `"Unknown"`. body.properties.Status.select.name should be defined, instead was `undefined`.
The SelectPropertyValue is created with a SelectOption with just the Id
field specified, like this;
new SelectPropertyValue
{
Select = new SelectOption
{
Id = value.ToString()
}
}
The default value of the Color
enum is Unknown
. For Color.Unknown
, unfortunately [EnumMember(Value = null)]
does not have the intended effect - instead it falls back to a .ToString()
representation of the enum ("Unknown"
), which the Notion API does not recognize.
The only way to work around this currently, is to actually provide the correct color for the select option, which is not ideal as you may not necessarily know what that is (and it has to match).
(The error about the name
field appears to be a mistake, as it goes away if you provide an allowed color.)