# serializr-fp API documentation [](https://www.npmjs.com/serializr-fp) > (De)serialize complex object graphs to/from JSON ## Constants
symbolModelSchema.<Date, string>ModelSchema.<Date, string>ModelSchema.<TYPE, TYPE>PropertySchema.<OBJECT, JSON>ModelSchema.<Array.<OBJECT>, Array.<JSON>>PropertySchema.<OBJECT, JSON>ObjectModelSchema.<OBJECT>ObjectModelSchema.<OBJECT>Omit values after serialization.
While skipBy is useful to skip single values from an object, there are
situations where you want to skip all properties if they are a certain value.
In this case, it's easier to use this omitBy schema on the object schema.
ObjectModelSchema.<OBJECT>Omit null values after serialization.
PropertySchema.<OBJECT, JSON>PropertySchema.<OBJECT, JSON>Skip the value after serialization if predicate returns true, in case the BE doesn't want to receive certain values.
Some REST API's rather have the key not being there than having a certain
value they see as a nil value, like null, "" or {}. In that case, this
skip schema can be used with a predicate function to check.
PropertySchema.<OBJECT, JSON>Skip null value after serialization.
Also checks undefined values, to avoid conflicts with required properties.
The required check is done as last and turns values into null if needed.
ModelSchema.<OBJECT, JSON> | PropertySchema.<OBJECT, JSON>Use a default value after deserialization, in cae the value turns up undefined.
ModelSchema.<OBJECT, JSON> | PropertySchema.<OBJECT, JSON>Use a default json value before deserialization, in case the original value is undefined.
This can be very handy in case a sub-object is undefined, but you want the object to always be there, having it's properties initialized. For example, a patient object which has a person property to hold all it's name parts. In that case, you always want the person object to be there and have the name parts set to null instead, so you can use it in a form to fill out.
OBJECTModelSchema.<OBJECT, Object>Object.<string, PropertySchema>ObjectTARGETObjectTARGETsymbol
**Kind**: global constant
## DATE_ONLY : ModelSchema.<Date, string>
**Kind**: global constant
## DATE : ModelSchema.<Date, string>
**Kind**: global constant
## PRIMITIVE : ModelSchema.<TYPE, TYPE>
**Kind**: global constant
**Template**: TYPE
## alias(property, schema) ⇒ PropertySchema.<OBJECT, JSON>
**Kind**: global function
**Template**: OBJECT, JSON
| Param | Type |
| --- | --- |
| property | string |
| schema | ModelSchema.<OBJECT, JSON> \| PropertySchema.<OBJECT, JSON> |
## array(schema) ⇒ ModelSchema.<Array.<OBJECT>, Array.<JSON>>
**Kind**: global function
**Template**: OBJECT, JSON
| Param | Type |
| --- | --- |
| schema | ModelSchema.<OBJECT, JSON> |
## computed(compute) ⇒ PropertySchema.<OBJECT, JSON>
**Kind**: global function
**Template**: OBJECT, JSON
| Param | Type |
| --- | --- |
| compute | ComputeObjectModel.<OBJECT, JSON> |
## object(schema) ⇒ ObjectModelSchema.<OBJECT>
**Kind**: global function
**Template**: OBJECT
| Param | Type |
| --- | --- |
| schema | [ObjectSchema](#ObjectSchema) |
## omitBy(predicate, schema) ⇒ ObjectModelSchema.<OBJECT>
Omit values after serialization.
While `skipBy` is useful to skip single values from an object, there are
situations where you want to skip all properties if they are a certain value.
In this case, it's easier to use this `omitBy` schema on the `object` schema.
**Kind**: global function
**Template**: OBJECT
**See**: [skipBy](#skipBy)
| Param | Type |
| --- | --- |
| predicate | function |
| schema | ObjectModelSchema.<OBJECT> |
## omitNull(schema) ⇒ ObjectModelSchema.<OBJECT>
Omit `null` values after serialization.
**Kind**: global function
**Template**: OBJECT
**See**: [omitBy](#omitBy)
| Param | Type |
| --- | --- |
| schema | ObjectModelSchema.<OBJECT> |
## optional(schema) ⇒ PropertySchema.<OBJECT, JSON>
**Kind**: global function
**Template**: OBJECT, JSON
| Param | Type |
| --- | --- |
| schema | ModelSchema.<OBJECT, JSON> \| PropertySchema.<OBJECT, JSON> |
## skipBy(predicate, schema) ⇒ PropertySchema.<OBJECT, JSON>
Skip the value after serialization if predicate returns true,
in case the BE doesn't want to receive certain values.
Some REST API's rather have the key not being there than having a certain
value they see as a nil value, like `null`, `""` or `{}`. In that case, this
skip schema can be used with a predicate function to check.
**Kind**: global function
**Template**: OBJECT, JSON
| Param | Type |
| --- | --- |
| predicate | function |
| schema | ModelSchema.<OBJECT, JSON> \| PropertySchema.<OBJECT, JSON> |
## skipNull(schema) ⇒ PropertySchema.<OBJECT, JSON>
Skip `null` value after serialization.
Also checks undefined values, to avoid conflicts with required properties.
The required check is done as last and turns values into `null` if needed.
**Kind**: global function
**Template**: OBJECT, JSON
**See**: [skipBy](#skipBy)
| Param | Type |
| --- | --- |
| schema | ModelSchema.<OBJECT, JSON> \| PropertySchema.<OBJECT, JSON> |
## withDefault(defaultValue, schema) ⇒ ModelSchema.<OBJECT, JSON> \| PropertySchema.<OBJECT, JSON>
Use a default value after deserialization,
in cae the value turns up undefined.
**Kind**: global function
**Template**: OBJECT, JSON
| Param | Type |
| --- | --- |
| defaultValue | OBJECT |
| schema | ModelSchema.<OBJECT, JSON> \| PropertySchema.<OBJECT, JSON> |
## withJsonDefault(defaultValue, schema) ⇒ ModelSchema.<OBJECT, JSON> \| PropertySchema.<OBJECT, JSON>
Use a default json value before deserialization,
in case the original value is undefined.
This can be very handy in case a sub-object is undefined, but you want the
object to always be there, having it's properties initialized. For example,
a patient object which has a person property to hold all it's name parts. In
that case, you always want the person object to be there and have the name
parts set to null instead, so you can use it in a form to fill out.
**Kind**: global function
**Template**: OBJECT, JSON
| Param | Type |
| --- | --- |
| defaultValue | JSON |
| schema | ModelSchema.<OBJECT, JSON> \| PropertySchema.<OBJECT, JSON> |
## ComputeObjectModel ⇒ OBJECT
**Kind**: global typedef
**Template**: OBJECT, JSON
| Param | Type | Description |
| --- | --- | --- |
| json | Object | |
| property | string | |
| {JSON) | | value |
## ObjectModelSchema : ModelSchema.<OBJECT, Object>
**Kind**: global typedef
**Template**: OBJECT
## ObjectSchema : Object.<string, PropertySchema>
**Kind**: global typedef
## PropertySchema : Object
**Kind**: global typedef
**Template**: OBJECT, JSON
**Properties**
| Name | Type |
| --- | --- |
| [property] | string |
| serialize | PropertyTransformer.<OBJECT, JSON> |
| deserialize | PropertyTransformer.<JSON, OBJECT> |
## PropertyTransformer ⇒ TARGET
**Kind**: global typedef
**Template**: SOURCE, TARGET
| Param | Type |
| --- | --- |
| value | SOURCE |
| source | Object |
| property | string |
## ModelSchema : Object
**Kind**: global typedef
**Template**: OBJECT, JSON
**Properties**
| Name | Type |
| --- | --- |
| serialize | ModelTransformer.<OBJECT, JSON> |
| deserialize | ModelTransformer.<JSON, OBJECT> |
## ModelTransformer ⇒ TARGET
**Kind**: global typedef
**Template**: SOURCE, TARGET
| Param | Type |
| --- | --- |
| value | SOURCE |