Fleece


Newtonsoft Module

Namespace: Fleece

Assembly: Fleece.NewtonsoftJson.dll

Types and nested modules

Type/Module Description

Codec

Functions operating on Codecs (as pair of functions)

Decode

Helpers

JsonCodec

JsonDecode

JsonEncode

Lens

Operators

Codec<'S1, 'S2, 't1, 't2>

A decoder from raw type 'S1 and encoder to raw type 'S2 for string types 't1 and 't2.

Codec<'S1, 'S2, 't>

A decoder from raw type 'S1 and encoder to raw type 'S2 for type 't.

Codec<'S, 't>

A codec for raw type 'S to strong type 't.

ConcreteCodec<'S1, 'S2, 't1, 't2>

A specific type to represent codecs, with associated operations

DecodeError

Decoder<'S, 't>

Decodes a value of raw type 'S into a value of generic type 't, possibly returning an error.

Encoder<'S, 't>

Encodes a value of a generic type 't into a value of raw type 'S.

JType

JsonObject

JsonValue

OfJson

'a ParseResult

SplitCodec<'S, 't1, 't2>

A codec for raw type 'S decoding to strong type 't1 and encoding to strong type 't2.

ToJson

Functions and values

Function or value Description

JArray x

Full Usage: JArray x

Parameters:
Returns: JToken

x : IReadOnlyList<JToken>
Returns: JToken

JBool x

Full Usage: JBool x

Parameters:
    x : bool

Returns: JToken

x : bool
Returns: JToken

JDate x

Full Usage: JDate x

Parameters:
Returns: JToken

x : DateTime
Returns: JToken

JNull

Full Usage: JNull

Returns: JToken

Returns: JToken

JNumber x

Full Usage: JNumber x

Parameters:
    x : decimal

Returns: JToken

x : decimal
Returns: JToken

JObject x

Full Usage: JObject x

Parameters:
Returns: JToken

x : IReadOnlyDictionary<string, JToken>
Returns: JToken

JString x

Full Usage: JString x

Parameters:
    x : string

Returns: JToken

x : string
Returns: JToken

diApply combiner (arg2, arg3) (arg4, arg5)

Full Usage: diApply combiner (arg2, arg3) (arg4, arg5)

Parameters:
Returns: ('S -> Result<'r, DecodeError>) * ('T -> 'a)

combiner : 'S -> 'S -> 'a
arg1 : Decoder<'S, ('f -> 'r)>
arg2 : Encoder<'S, 'T>
arg3 : Decoder<'S, 'f>
arg4 : Encoder<'S, 'T>
Returns: ('S -> Result<'r, DecodeError>) * ('T -> 'a)

dictAsProps x

Full Usage: dictAsProps x

Parameters:
Returns: (string * JToken)[]

x : IReadOnlyDictionary<string, JToken>
Returns: (string * JToken)[]

getJType o

Full Usage: getJType o

Parameters:
Returns: JType

o : JsonValue
Returns: JType

getJsonValueCodec ()

Full Usage: getJsonValueCodec ()

Parameters:
    () : unit

Returns: Codec<JsonValue, ^t>

Derive automatically a JsonCodec, based of OfJson and ToJson static members

() : unit
Returns: Codec<JsonValue, ^t>

jfield fieldName getter (arg3, arg4)

Full Usage: jfield fieldName getter (arg3, arg4)

Parameters:
Returns: (IReadOnlyDictionary<string, JsonValue> -> Result<'Rest, DecodeError>) * ('T -> IReadOnlyDictionary<string, JsonValue>) The resulting object codec.

Appends a field mapping to the codec.

fieldName : string

A string that will be used as key to the field.

getter : 'T -> ^Value

The field getter function.

arg2 : Decoder<IReadOnlyDictionary<string, JsonValue>, (^Value -> 'Rest)>
arg3 : Encoder<IReadOnlyDictionary<string, JsonValue>, 'T>
Returns: (IReadOnlyDictionary<string, JsonValue> -> Result<'Rest, DecodeError>) * ('T -> IReadOnlyDictionary<string, JsonValue>)

The resulting object codec.

jfieldOpt fieldName getter (arg3, arg4)

Full Usage: jfieldOpt fieldName getter (arg3, arg4)

Parameters:
Returns: (IReadOnlyDictionary<string, JsonValue> -> Result<'Rest, DecodeError>) * ('T -> IReadOnlyDictionary<string, JsonValue>) The resulting object codec.

Appends an optional field mapping to the codec.

fieldName : string

A string that will be used as key to the field.

getter : 'T -> ^Value option

The field getter function.

arg2 : Decoder<IReadOnlyDictionary<string, JsonValue>, (^Value option -> 'Rest)>
arg3 : Encoder<IReadOnlyDictionary<string, JsonValue>, 'T>
Returns: (IReadOnlyDictionary<string, JsonValue> -> Result<'Rest, DecodeError>) * ('T -> IReadOnlyDictionary<string, JsonValue>)

The resulting object codec.

jfieldOptWith (arg1, arg2) fieldName getter (arg5, arg6)

Full Usage: jfieldOptWith (arg1, arg2) fieldName getter (arg5, arg6)

Parameters:
Returns: (IReadOnlyDictionary<string, JsonValue> -> Result<'Rest, DecodeError>) * ('T -> IReadOnlyDictionary<string, JsonValue>) The resulting object codec.

Appends an optional field mapping to the codec.

arg0 : JsonValue -> ^a
arg1 : 'Value -> JsonValue
fieldName : string

A string that will be used as key to the field.

getter : 'T -> 'Value option

The field getter function.

arg4 : Decoder<IReadOnlyDictionary<string, JsonValue>, ('b option -> 'Rest)>
arg5 : Encoder<IReadOnlyDictionary<string, JsonValue>, 'T>
Returns: (IReadOnlyDictionary<string, JsonValue> -> Result<'Rest, DecodeError>) * ('T -> IReadOnlyDictionary<string, JsonValue>)

The resulting object codec.

jfieldWith (arg1, arg2) fieldName getter (arg5, arg6)

Full Usage: jfieldWith (arg1, arg2) fieldName getter (arg5, arg6)

Parameters:
Returns: (IReadOnlyDictionary<string, JsonValue> -> Result<'Rest, DecodeError>) * ('T -> IReadOnlyDictionary<string, JsonValue>) The resulting object codec.

Appends a field mapping to the codec.

arg0 : JsonValue -> Result<'a, DecodeError>
arg1 : 'Value -> JsonValue
fieldName : string

A string that will be used as key to the field.

getter : 'T -> 'Value

The field getter function.

arg4 : Decoder<IReadOnlyDictionary<string, JsonValue>, ('a -> 'Rest)>
arg5 : Encoder<IReadOnlyDictionary<string, JsonValue>, 'T>
Returns: (IReadOnlyDictionary<string, JsonValue> -> Result<'Rest, DecodeError>) * ('T -> IReadOnlyDictionary<string, JsonValue>)

The resulting object codec.

jget o key

Full Usage: jget o key

Parameters:
Returns: Result<^a, DecodeError>

Gets a value from a Json object

o : IReadOnlyDictionary<string, JsonValue>
key : string
Returns: Result<^a, DecodeError>

jgetOpt o key

Full Usage: jgetOpt o key

Parameters:
Returns: Result<^a option, DecodeError>

Tries to get a value from a Json object. Returns None if key is not present in the object.

o : IReadOnlyDictionary<string, JsonValue>
key : string
Returns: Result<^a option, DecodeError>

jgetOptWith ofJson o key

Full Usage: jgetOptWith ofJson o key

Parameters:
Returns: Result<'b option, 'c>

Tries to get a value from a Json object. Returns None if key is not present in the object.

ofJson : JsonValue -> ^a
o : IReadOnlyDictionary<string, JsonValue>
key : string
Returns: Result<'b option, 'c>

jgetWith ofJson o key

Full Usage: jgetWith ofJson o key

Parameters:
Returns: Result<'a, DecodeError>

Gets a value from a Json object

ofJson : JsonValue -> Result<'a, DecodeError>
o : IReadOnlyDictionary<string, JsonValue>
key : string
Returns: Result<'a, DecodeError>

jobj x

Full Usage: jobj x

Parameters:
Returns: JToken

Creates a new Json object for serialization

x : seq<string * JToken>
Returns: JToken

jpair key value

Full Usage: jpair key value

Parameters:
    key : string
    value : ^a

Returns: string * JsonValue

Creates a new Json key-value pair for a Json object

key : string
value : ^a
Returns: string * JsonValue

jpairOpt key value

Full Usage: jpairOpt key value

Parameters:
    key : string
    value : ^a option

Returns: string * JToken

Creates a new Json key-value pair for a Json object if the value option is present

key : string
value : ^a option
Returns: string * JToken

jpairOptWith toJson key value

Full Usage: jpairOptWith toJson key value

Parameters:
    toJson : 'a -> JToken
    key : string
    value : 'a option

Returns: string * JToken

Creates a new Json key-value pair for a Json object if the value option is present

toJson : 'a -> JToken
key : string
value : 'a option
Returns: string * JToken

jpairWith toJson key value

Full Usage: jpairWith toJson key value

Parameters:
    toJson : 'a -> 'b
    key : string
    value : 'a

Returns: string * 'b

Creates a new Json key-value pair for a Json object

toJson : 'a -> 'b
key : string
value : 'a
Returns: string * 'b

jsonObjToValueCodec

Full Usage: jsonObjToValueCodec

Returns: ('a -> Result<IReadOnlyDictionary<string, JToken>, DecodeError>) * ('b -> JToken)

A pair of functions representing a codec to encode a Dictionary into a Json value and the other way around.

Returns: ('a -> Result<IReadOnlyDictionary<string, JToken>, DecodeError>) * ('b -> JToken)

jsonObjectGetValues x

Full Usage: jsonObjectGetValues x

Parameters:
Returns: IReadOnlyDictionary<string, JToken>

x : JObject
Returns: IReadOnlyDictionary<string, JToken>

jsonValueCodec

Full Usage: jsonValueCodec

Returns: Codec<JsonValue, ^t>

Derive automatically a JsonCodec, based of OfJson and ToJson static members

Returns: Codec<JsonValue, ^t>

jsonValueToTextCodec

Full Usage: jsonValueToTextCodec

Returns: (string -> Result<JToken, DecodeError>) * (JsonValue -> string)

A pair of functions representing a codec to encode a Json value to a Json text and the other way around.

Returns: (string -> Result<JToken, DecodeError>) * (JsonValue -> string)

ofJson x

Full Usage: ofJson x

Parameters:
Returns: ^t ParseResult

Maps Json to a type

x : JsonValue
Returns: ^t ParseResult

parseJson x

Full Usage: parseJson x

Parameters:
    x : string

Returns: ^a ParseResult

Parses a Json Text and maps to a type

x : string
Returns: ^a ParseResult

retype x

Full Usage: retype x

Parameters:
    x : 'a

Returns: 'b

x : 'a
Returns: 'b

toJson x

Full Usage: toJson x

Parameters:
    x : ^t

Returns: JsonValue

Maps a value to Json

x : ^t
Returns: JsonValue

withFields f

Full Usage: withFields f

Parameters:
    f : 'a - An object constructor as a curried function.

Returns: ('b -> Result<'a, 'c>) * ('d -> IReadOnlyDictionary<'e, 'f>) The resulting object codec.

Initialize the field mappings.

f : 'a

An object constructor as a curried function.

Returns: ('b -> Result<'a, 'c>) * ('d -> IReadOnlyDictionary<'e, 'f>)

The resulting object codec.

Type extensions

Type extension Description

this.AsReadOnlyDictionary()

Full Usage: this.AsReadOnlyDictionary()

Parameters:
    () : unit

Returns: IReadOnlyDictionary<string, JToken>

Extended Type: JObject

() : unit
Returns: IReadOnlyDictionary<string, JToken>

JObject.GetValues(x)

Full Usage: JObject.GetValues(x)

Parameters:
Returns: IReadOnlyDictionary<string, JToken>

Extended Type: JObject

x : JObject
Returns: IReadOnlyDictionary<string, JToken>

Active patterns

Active pattern Description

(|JArray|JObject|JNumber|JBool|JString|JNull|JDate|) o

Full Usage: (|JArray|JObject|JNumber|JBool|JString|JNull|JDate|) o

Parameters:
Returns: Choice<IReadOnlyList<JToken>, IReadOnlyDictionary<string, JToken>, JToken, bool, string, unit, JToken>

o : JToken
Returns: Choice<IReadOnlyList<JToken>, IReadOnlyDictionary<string, JToken>, JToken, bool, string, unit, JToken>