Legivel.Mapper Processing Options
Calling Deserialize
will run the yaml-to-model conversion with default options.
With the DeserializeWithOptions
, you can customize your yaml processing.
Cross Check
By default, the model is leading, which means that any extra yaml in the source document will be ignored
as long as it minimally includes all content required for the target model. With the processing option MappingMode
you can require cross-check between content and model.
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: |
|
Which results in:
|
Cross checking has the following options:
1: 2: 3: 4: 5: 6: 7: 8: |
|
certain cases: Record types.
namespace Legivel
module Serialization
from Legivel
from Legivel
namespace System
type ProcessingOptionsType =
{Name: string;
EMail: string option;}
{Name: string;
EMail: string option;}
ProcessingOptionsType.Name: string
Multiple items
val string : value:'T -> string
--------------------
type string = String
val string : value:'T -> string
--------------------
type string = String
ProcessingOptionsType.EMail: string option
type 'T option = Option<'T>
val yml : string
val DeserializeWithOptions : options:ProcessingOption list -> yaml:string -> DeserializeResult<'tp> list
union case ProcessingOption.MappingMode: MapYaml -> ProcessingOption
type MapYaml =
| ToModelOnly = 0
| WithCrossCheck = 1
| AndRequireFullProjection = 2
| ToModelOnly = 0
| WithCrossCheck = 1
| AndRequireFullProjection = 2