JsonRuntime Type
Static helper methods called from the generated code for working with JSON
Static members
| Static member |
Description
|
Full Usage:
JsonRuntime.ConvertArray(doc, mapping)
Parameters:
IJsonDocument
mapping : Func<IJsonDocument, 'T>
Returns: 'T[]
Type parameters: 'T |
Converts JSON array to array of target types
|
Full Usage:
JsonRuntime.ConvertBoolean(json)
Parameters:
JsonValue option
Returns: bool option
|
|
|
|
Full Usage:
JsonRuntime.ConvertDateTimeOffset(cultureStr, json)
Parameters:
string
json : JsonValue option
Returns: DateTimeOffset option
|
|
Full Usage:
JsonRuntime.ConvertDecimal(cultureStr, json)
Parameters:
string
json : JsonValue option
Returns: decimal option
|
|
Full Usage:
JsonRuntime.ConvertFloat(cultureStr, missingValuesStr, json)
Parameters:
string
missingValuesStr : string
json : JsonValue option
Returns: float option
|
|
|
|
Full Usage:
JsonRuntime.ConvertInteger(cultureStr, json)
Parameters:
string
json : JsonValue option
Returns: int option
|
|
Full Usage:
JsonRuntime.ConvertInteger64(cultureStr, json)
Parameters:
string
json : JsonValue option
Returns: int64 option
|
|
Full Usage:
JsonRuntime.ConvertOptionalProperty(doc, name, mapping)
Parameters:
IJsonDocument
name : string
mapping : Func<IJsonDocument, 'T>
Returns: 'T option
Type parameters: 'T |
Get optional json property and convert to a specified type
|
Full Usage:
JsonRuntime.ConvertRecordToDictionary(doc, mappingKey, mappingValue)
Parameters:
IJsonDocument
mappingKey : Func<IJsonDocument, 'Key>
mappingValue : Func<IJsonDocument, 'Value>
Returns: ('Key * 'Value) seq
Type parameters: 'Key, 'Value (requires equality) |
Converts JSON record to dictionary
|
Full Usage:
JsonRuntime.ConvertString(cultureStr, json)
Parameters:
string
json : JsonValue option
Returns: string option
|
|
|
|
Full Usage:
JsonRuntime.CreateArray(elements, cultureStr)
Parameters:
obj[]
cultureStr : string
Returns: IJsonDocument
|
Creates a scalar JsonValue.Array and wraps it in a json document
|
Full Usage:
JsonRuntime.CreateRecord(properties, cultureStr)
Parameters:
(string * obj)[]
cultureStr : string
Returns: IJsonDocument
|
|
Full Usage:
JsonRuntime.CreateRecordFromDictionary(keyValuePairs, cultureStr, mappingKeyBack)
Parameters:
('Key * 'Value) seq
cultureStr : string
mappingKeyBack : Func<'Key, string>
Returns: IJsonDocument
Type parameters: 'Key, 'Value (requires equality) |
|
Full Usage:
JsonRuntime.CreateRecordOmitNulls(properties, cultureStr)
Parameters:
(string * obj)[]
cultureStr : string
Returns: IJsonDocument
|
|
Full Usage:
JsonRuntime.CreateValue(value, cultureStr)
Parameters:
obj
cultureStr : string
Returns: IJsonDocument
|
Creates a scalar JsonValue and wraps it in a json document
|
Full Usage:
JsonRuntime.GetArrayChildByTypeTag(doc, cultureStr, tagCode)
Parameters:
IJsonDocument
cultureStr : string
tagCode : string
Returns: IJsonDocument
|
Returns a single array children that matches the specified tag
|
Full Usage:
JsonRuntime.GetArrayChildrenByTypeTag(doc, cultureStr, tagCode, mapping)
Parameters:
IJsonDocument
cultureStr : string
tagCode : string
mapping : Func<IJsonDocument, 'T>
Returns: 'T[]
Type parameters: 'T |
Returns all array values that match the specified tag
|
Full Usage:
JsonRuntime.GetKeysFromInferedDictionary(doc, mappingKey)
Parameters:
IJsonDocument
mappingKey : Func<IJsonDocument, 'Key>
Returns: 'Key[]
Type parameters: 'Key (requires equality) |
Get keys from infered dictionary
|
Full Usage:
JsonRuntime.GetNonOptionalValue(path, opt, originalValue)
Parameters:
string
opt : 'T option
originalValue : JsonValue option
Returns: 'T
Type parameters: 'T |
Operation that extracts the value from an option and reports a meaningful error message when the value is not there If the originalValue is a scalar, for missing strings we return "", and for missing doubles we return NaN For other types an error is thrown
|
Full Usage:
JsonRuntime.GetNonOptionalValueStrict(path, opt, originalValue)
Parameters:
string
opt : 'T option
originalValue : JsonValue option
Returns: 'T
Type parameters: 'T |
Operation that extracts the value from an option and always throws if the value is not present. Used when ExceptionIfMissing=true to raise an exception for missing fields instead of returning defaults.
|
Full Usage:
JsonRuntime.GetPropertyPacked(doc, name)
Parameters:
IJsonDocument
name : string
Returns: IJsonDocument
|
Get json property and wrap in json document
|
Full Usage:
JsonRuntime.GetPropertyPackedOrNull(doc, name)
Parameters:
IJsonDocument
name : string
Returns: IJsonDocument
|
Get json property and wrap in json document, and return null if not found
|
Full Usage:
JsonRuntime.GetRecordProperties(doc)
Parameters:
IJsonDocument
Returns: (string * JsonValue)[]
|
|
Full Usage:
JsonRuntime.GetValueByKeyFromInferedDictionary(doc, mappingKey, mappingValue, key)
Parameters:
IJsonDocument
mappingKey : Func<IJsonDocument, 'Key>
mappingValue : Func<IJsonDocument, 'Value>
key : 'Key
Returns: 'Value
Type parameters: 'Key, 'Value (requires equality) |
Get a value by the key from infered dictionary
|
Full Usage:
JsonRuntime.GetValuesFromInferedDictionary(doc, mappingValue)
Parameters:
IJsonDocument
mappingValue : Func<IJsonDocument, 'Value>
Returns: 'Value[]
Type parameters: 'Value |
Get values from infered dictionary
|
Full Usage:
JsonRuntime.InferedDictionaryContainsKey(doc, mappingKey, key)
Parameters:
IJsonDocument
mappingKey : Func<IJsonDocument, 'Key>
key : 'Key
Returns: bool
Type parameters: 'Key (requires equality) |
Get a value by the key from infered dictionary
|
Full Usage:
JsonRuntime.TryGetArrayChildByTypeTag(doc, cultureStr, tagCode, mapping)
Parameters:
IJsonDocument
cultureStr : string
tagCode : string
mapping : Func<IJsonDocument, 'T>
Returns: 'T option
Type parameters: 'T |
Returns single or no value from an array matching the specified tag
|
Full Usage:
JsonRuntime.TryGetPropertyPacked(doc, name)
Parameters:
IJsonDocument
name : string
Returns: IJsonDocument option
|
Get optional json property wrapped in json document
|
Full Usage:
JsonRuntime.TryGetPropertyUnpacked(doc, name)
Parameters:
IJsonDocument
name : string
Returns: JsonValue option
|
|
Full Usage:
JsonRuntime.TryGetPropertyUnpackedWithPath(doc, name)
Parameters:
IJsonDocument
name : string
Returns: JsonValueOptionAndPath
|
Get optional json property and wrap it together with path
|
Full Usage:
JsonRuntime.TryGetValueByKeyFromInferedDictionary(doc, mappingKey, mappingValue, key)
Parameters:
IJsonDocument
mappingKey : Func<IJsonDocument, 'Key>
mappingValue : Func<IJsonDocument, 'Value>
key : 'Key
Returns: 'Value option
Type parameters: 'Key, 'Value (requires equality) |
Try get a value by the key from infered dictionary
|
Full Usage:
JsonRuntime.TryGetValueByTypeTag(doc, cultureStr, tagCode, mapping)
Parameters:
IJsonDocument
cultureStr : string
tagCode : string
mapping : Func<IJsonDocument, 'T>
Returns: 'T option
Type parameters: 'T |
Returns a single or no value by tag type
|
Full Usage:
JsonRuntime.WithRecordProperty(doc, name, value, cultureStr)
Parameters:
IJsonDocument
name : string
value : obj
cultureStr : string
Returns: IJsonDocument
|
|
FSharp.Data