Skip to content

Configuration

Serinus applications can be tweaked by changing the pubspec.yaml file.

Serinus Configuration

The Serinus configuration is done by adding a serinus key to the pubspec.yaml file. This key can have the following options:

OptionDescriptionDefault
modelsThe configuration for the models generation{}

Models Configuration

The models key can have the following options:

OptionDescriptionDefault
extensionsThe extensions used by the code generation libraries for example g[]
deserialize_keywordsThe keywords used to deserialize the JSON objects[]
serialize_keywordsThe keywords used to serialize the Dart objects[]

The deserialize_keywords and serialize_keywords keys can have the following options:

OptionDescriptionDefault
keywordThe keyword to be used
static_methodIf the keyword is a static method (only for deserialize_keywords)false

The following is an example of the Serinus configuration:

yaml
serinus:
  models:
    extensions:
      - test
    deserialize_keywords:
      - keyword: fromRequest
        static_method: true
    serialize_keywords:
      - keyword: toResponse

Built with 💙 and Dart 🎯 | One of the 🐤 of Avesbox