A required member is missing

An item has no value for a member that is not optional.

  • Error
  • BEVEL092

What it means

Bevel checks every item. A member is required when it is not nullable and has no default. The message lists every missing member of the item. When the type has a record processor, Bevel checks after processors run, for non-nullable reference members.

Example message

text
Data/Posts/BlogPost.cs(6,15): error BEVEL092: Dataset 'Posts': 'hello.md': 'Title' is required but missing. Add 'title:' to the data, give the parameter a default value, or make it nullable (string?). Help: https://khalidabuhakmeh.github.io/bevel/reference/diagnostics/bevel092/

How to fix

Pick one:

  1. Add the value to the item's data, like title: in front matter.
  2. Give the member a default value.
  3. Make it nullable, like string?.
  4. Set it in your processor, if one fills it in.
csharp
public sealed record BlogPost(string Title, string Summary);
public sealed record BlogPost(string Title, string? Summary = null);