> For the complete documentation index, see [llms.txt](https://darwin-framework.gitbook.io/dogs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://darwin-framework.gitbook.io/dogs/guides/2.-first-serializable.md).

# 2. First Serializable

You can create serializable classes by annotating the with `@serializable` and providing an unnamed constructor for all final serializable fields. This must either be the default constructor, or a constructor named `dog`. Additionally, you should add the self-referencing Dataclass mixin.

```dart
@serializable
class Person with Dataclass<Person> {

  String name;
  int age;
  Set<String>? tags;
  
  Person(this.name, this.age, this.tags);
  
}

// Enums can also be serialized!
@serialzable
enum MyEnum {
  a,b,c;
}
```

For other types of structure definitions, have a look at [Conformity](/dogs/concepts/conformity.md).

{% hint style="warning" %}
You don't have to run the build\_runner while working on your project, unless you require the direct use of generated classes, such as Builders. But remember you have to run it after you have made changes to the model for them to take effect at runtime. **So remember to run build\_runner before running the application.**
{% endhint %}

{% hint style="success" %}
Use **`dart run build_runner watch`**&#x66;or automatic code generation.
{% endhint %}
