Skip to content

Commit

Permalink
Make Color enum property nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
KoditkarVedant committed Aug 20, 2022
1 parent 5023e2c commit c76c1c4
Show file tree
Hide file tree
Showing 15 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ public class SelectOptionSchema

[JsonProperty("color")]
[JsonConverter(typeof(StringEnumConverter))]
public Color Color { get; set; }
public Color? Color { get; set; }
}
}
2 changes: 1 addition & 1 deletion Src/Notion.Client/Models/Blocks/BulletedListItemBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class Info

[JsonProperty("color")]
[JsonConverter(typeof(StringEnumConverter))]
public Color Color { get; set; }
public Color? Color { get; set; }

[JsonProperty("children")]
public IEnumerable<INonColumnBlock> Children { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion Src/Notion.Client/Models/Blocks/CalloutBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class Info

[JsonProperty("color")]
[JsonConverter(typeof(StringEnumConverter))]
public Color Color { get; set; }
public Color? Color { get; set; }

[JsonProperty("children")]
public IEnumerable<INonColumnBlock> Children { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion Src/Notion.Client/Models/Blocks/HeadingOneBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class Info

[JsonProperty("color")]
[JsonConverter(typeof(StringEnumConverter))]
public Color Color { get; set; }
public Color? Color { get; set; }
}
}
}
2 changes: 1 addition & 1 deletion Src/Notion.Client/Models/Blocks/HeadingThreeeBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class Info

[JsonProperty("color")]
[JsonConverter(typeof(StringEnumConverter))]
public Color Color { get; set; }
public Color? Color { get; set; }
}
}
}
2 changes: 1 addition & 1 deletion Src/Notion.Client/Models/Blocks/HeadingTwoBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class Info

[JsonProperty("color")]
[JsonConverter(typeof(StringEnumConverter))]
public Color Color { get; set; }
public Color? Color { get; set; }
}
}
}
2 changes: 1 addition & 1 deletion Src/Notion.Client/Models/Blocks/NumberedListItemBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class Info

[JsonProperty("color")]
[JsonConverter(typeof(StringEnumConverter))]
public Color Color { get; set; }
public Color? Color { get; set; }

[JsonProperty("children")]
public IEnumerable<INonColumnBlock> Children { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion Src/Notion.Client/Models/Blocks/ParagraphBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class Info

[JsonProperty("color")]
[JsonConverter(typeof(StringEnumConverter))]
public Color Color { get; set; }
public Color? Color { get; set; }

[JsonProperty("children")]
public IEnumerable<INonColumnBlock> Children { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion Src/Notion.Client/Models/Blocks/QuoteBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class Info

[JsonProperty("color")]
[JsonConverter(typeof(StringEnumConverter))]
public Color Color { get; set; }
public Color? Color { get; set; }

[JsonProperty("children")]
public IEnumerable<INonColumnBlock> Children { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion Src/Notion.Client/Models/Blocks/TableOfContentsBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class Data
{
[JsonProperty("color")]
[JsonConverter(typeof(StringEnumConverter))]
public Color Color { get; set; }
public Color? Color { get; set; }
}
}
}
2 changes: 1 addition & 1 deletion Src/Notion.Client/Models/Blocks/ToDoBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class Info

[JsonProperty("color")]
[JsonConverter(typeof(StringEnumConverter))]
public Color Color { get; set; }
public Color? Color { get; set; }

[JsonProperty("children")]
public IEnumerable<INonColumnBlock> Children { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion Src/Notion.Client/Models/Blocks/ToggleBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class Info

[JsonProperty("color")]
[JsonConverter(typeof(StringEnumConverter))]
public Color Color { get; set; }
public Color? Color { get; set; }

[JsonProperty("children")]
public IEnumerable<INonColumnBlock> Children { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class SelectOption
/// </summary>
[JsonProperty("color")]
[JsonConverter(typeof(StringEnumConverter))]
public Color Color { get; set; }
public Color? Color { get; set; }
}

public class MultiSelectProperty : Property
Expand Down
2 changes: 1 addition & 1 deletion Src/Notion.Client/Models/Database/RichText/RichTextBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ public class Annotations

[JsonProperty("color")]
[JsonConverter(typeof(StringEnumConverter))]
public Color Color { get; set; }
public Color? Color { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class Data
/// </summary>
[JsonProperty("color")]
[JsonConverter(typeof(StringEnumConverter))]
public Color Color { get; set; }
public Color? Color { get; set; }
}

public enum Color
Expand Down

1 comment on commit c76c1c4

@HermanSchoenfeld
Copy link
Contributor

@HermanSchoenfeld HermanSchoenfeld commented on c76c1c4 Aug 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was Color made nullable? It is always present in JSON objects returned by Notion. Maybe only make nullable for pushing objects.

Please sign in to comment.