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 in the JSON element, the decoding will fail.
Static members
| Static member |
Description
|
Full Usage:
Property.array (name, decoder)
Parameters:
string
-
decoder : CollectErrorsDecoder<'TResult>
-
Returns: JsonElement -> Result<'TResult array, DecodeError list>
Modifiers: inline Type parameters: 'TResult |
Takes a property name and applies the given decoder to each element in the property as if it was a JSON array This method will attempt to decode the type and collect all the errors that occur during the decoding process.
|
Full Usage:
Property.array (name, decoder)
Parameters:
string
-
decoder : Decoder<'TResult>
-
Returns: JsonElement -> Result<'TResult array, DecodeError>
Modifiers: inline Type parameters: 'TResult |
Takes a property name and applies the given decoder to each element in the property as if it was a JSON array The decoding process will stop at the first failure and the error will be returned.
|
Full Usage:
Property.dict (name, decoder)
Parameters:
string
-
decoder : IndexedMapCollectErrorsDecoder<'TValue>
-
Returns: JsonElement -> Result<Dictionary<string, 'TValue>, DecodeError list>
Modifiers: inline Type parameters: 'TValue |
Takes a property name and applies the given decoder to the values on the properties of the object 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.
|
Full Usage:
Property.dict (name, decoder)
Parameters:
string
-
decoder : Decoder<'TValue>
-
Returns: JsonElement -> Result<Dictionary<string, 'TValue>, DecodeError>
Modifiers: inline Type parameters: 'TValue |
Takes a property name and applies the given decoder to the values on the properties of the object 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, DecodeError list>
Modifiers: inline Type parameters: 'TResult |
Takes the name of a property and a decoder and returns a function that can be used to decode the property. 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.
|
Full Usage:
Property.get (name, decoder)
Parameters:
string
-
decoder : Decoder<'TResult>
-
Returns: JsonElement -> Result<'TResult, DecodeError>
Modifiers: inline Type parameters: 'TResult |
Takes the name of a property and a decoder and returns a function that can be used to decode the property. The decoding process will stop at the first failure and the error will be returned.
|
Full Usage:
Property.list (name, decoder)
Parameters:
string
-
decoder : CollectErrorsDecoder<'TResult>
-
Returns: JsonElement -> Result<'TResult list, DecodeError list>
Modifiers: inline Type parameters: 'TResult |
Takes a property name and applies the given decoder to each element in the property as if it was a JSON array This method will attempt to decode the type and collect all the errors that occur during the decoding process.
|
Full Usage:
Property.list (name, decoder)
Parameters:
string
-
decoder : Decoder<'TResult>
-
Returns: JsonElement -> Result<'TResult list, DecodeError>
Modifiers: inline Type parameters: 'TResult |
Takes a property name and applies the given decoder to each element in the property as if it was a JSON array The decoding process will stop at the first failure and the error will be returned.
|
Full Usage:
Property.map (name, decoder)
Parameters:
string
-
decoder : IndexedMapCollectErrorsDecoder<'TValue>
-
Returns: JsonElement -> Result<Map<string, 'TValue>, DecodeError list>
Modifiers: inline Type parameters: 'TValue |
Takes a property name and applies the given decoder to the values on the properties of the object 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.
|
Full Usage:
Property.map (name, decoder)
Parameters:
string
-
decoder : Decoder<'TValue>
-
Returns: JsonElement -> Result<Map<string, 'TValue>, DecodeError>
Modifiers: inline Type parameters: 'TValue |
Takes a property name and applies the given decoder to the values on the properties of the object 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, DecodeError list>
Modifiers: inline Type parameters: 'TResult |
Takes a property name and applies the given decoder to each element in the property as if it was a JSON array 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.
|
Full Usage:
Property.seq (name, decoder)
Parameters:
string
-
decoder : Decoder<'TResult>
-
Returns: JsonElement -> Result<'TResult seq, DecodeError>
Modifiers: inline Type parameters: 'TResult |
Takes a property name and applies the given decoder to each element in the property as if it was a JSON array The decoding process will stop at the first failure and the error will be returned.
|
JDeck