Property Type
This type containes methods that are particularly useful to decode properties from JSON elements. They can be primitive properties, objects, arrays, etc.
If the property is not found or is null in the JSON element, the decoding will return an option type.
Static members
| Static member | Description |
Full Usage:
Property.array (name, decoder)
Parameters:
string
-
decoder : CollectErrorsDecoder<'TResult>
-
Returns: JsonElement -> Result<'TResult array voption, DecodeError list>
Modifiers: inline Type parameters: 'TResult |
This method will attempt to decode the type and collect all the errors that occur during the decoding process. If there's an error in the decoding process, the decoding will continue until there are no more, the returned error will contain a list of all the errors that occurred. The decoding process will fail only if the property is found, it matches the underlying type and the decoding fails. If the property is not found or is null, the decoding will return an option type.
|
Full Usage:
Property.array (name, decoder)
Parameters:
string
-
decoder : Decoder<'TResult>
-
Returns: JsonElement -> Result<'TResult array voption, DecodeError>
Modifiers: inline Type parameters: 'TResult |
The decoding process will fail only if the property is found, it matches the underlying type and the decoding fails. If the property is not found or is null, the decoding will return an option type.
|
Full Usage:
Property.dict (name, decoder)
Parameters:
string
-
decoder : IndexedMapCollectErrorsDecoder<'TValue>
-
Returns: JsonElement -> Result<Dictionary<string, 'TValue> voption, DecodeError list>
Modifiers: inline Type parameters: 'TValue |
This method will attempt to decode the type and collect all the errors that occur during the decoding process. If there's an error in the decoding process, the decoding will continue until there are no more, the returned error will contain a list of all the errors that occurred. The decoding process will fail only if the property is found, it matches the underlying type and the decoding fails. If the property is not found or is null, the decoding will return an option type.
|
Full Usage:
Property.dict (name, decoder)
Parameters:
string
-
decoder : Decoder<'TValue>
-
Returns: JsonElement -> Result<Dictionary<string, 'TValue> voption, DecodeError>
Modifiers: inline Type parameters: 'TValue |
The decoding process will stop at the first failure, and the error will be returned.
|
Full Usage:
Property.get (name, decoder)
Parameters:
string
-
decoder : CollectErrorsDecoder<'TResult>
-
Returns: JsonElement -> Result<'TResult voption, DecodeError list>
Modifiers: inline Type parameters: 'TResult |
This method will attempt to decode the type and collect all the errors that occur during the decoding process. If there's an error in the decoding process, the decoding will continue until there are no more, the returned error will contain a list of all the errors that occurred. The decoding process will fail only if the property is found, it matches the underlying type and the decoding fails. If the property is not found or is null, the decoding will return an option type.
|
Full Usage:
Property.get (name, decoder)
Parameters:
string
-
decoder : Decoder<'TResult>
-
Returns: JsonElement -> Result<'TResult voption, DecodeError>
Modifiers: inline Type parameters: 'TResult |
The decoding process will fail only if the property is found, it matches the underlying type and the decoding fails. If the property is not found or is null, the decoding will return an option type.
|
Full Usage:
Property.list (name, decoder)
Parameters:
string
-
decoder : CollectErrorsDecoder<'TResult>
-
Returns: JsonElement -> Result<'TResult list voption, DecodeError list>
Modifiers: inline Type parameters: 'TResult |
This method will attempt to decode the type and collect all the errors that occur during the decoding process. If there's an error in the decoding process, the decoding will continue until there are no more, the returned error will contain a list of all the errors that occurred. The decoding process will fail only if the property is found, it matches the underlying type and the decoding fails. If the property is not found or is null, the decoding will return an option type.
|
Full Usage:
Property.list (name, decoder)
Parameters:
string
-
decoder : Decoder<'TResult>
-
Returns: JsonElement -> Result<'TResult list voption, DecodeError>
Modifiers: inline Type parameters: 'TResult |
The decoding process will fail only if the property is found, it matches the underlying type and the decoding fails. If the property is not found or is null, the decoding will return an option type.
|
Full Usage:
Property.map (name, decoder)
Parameters:
string
-
decoder : IndexedMapCollectErrorsDecoder<'TValue>
-
Returns: JsonElement -> Result<Map<string, 'TValue> voption, DecodeError list>
Modifiers: inline Type parameters: 'TValue |
This method will attempt to decode the type and collect all the errors that occur during the decoding process. If there's an error in the decoding process, the decoding will continue until there are no more, the returned error will contain a list of all the errors that occurred. The decoding process will fail only if the property is found, it matches the underlying type and the decoding fails. If the property is not found or is null, the decoding will return an option type.
|
Full Usage:
Property.map (name, decoder)
Parameters:
string
-
decoder : Decoder<'TValue>
-
Returns: JsonElement -> Result<Map<string, 'TValue> voption, DecodeError>
Modifiers: inline Type parameters: 'TValue |
The decoding process will stop at the first failure, and the error will be returned.
|
Full Usage:
Property.seq (name, decoder)
Parameters:
string
-
decoder : CollectErrorsDecoder<'TResult>
-
Returns: JsonElement -> Result<'TResult seq voption, DecodeError list>
Modifiers: inline Type parameters: 'TResult |
This method will attempt to decode the type and collect all the errors that occur during the decoding process. If there's an error in the decoding process, the decoding will continue until there are no more, the returned error will contain a list of all the errors that occurred. The decoding process will fail only if the property is found, it matches the underlying type and the decoding fails. If the property is not found or is null, the decoding will return an option type.
|
Full Usage:
Property.seq (name, decoder)
Parameters:
string
-
decoder : Decoder<'TResult>
-
Returns: JsonElement -> Result<'TResult seq voption, DecodeError>
Modifiers: inline Type parameters: 'TResult |
The decoding process will fail only if the property is found, it matches the underlying type and the decoding fails. If the property is not found or is null, the decoding will return an option type.
|
JDeck