UnquotedJson 1.0.7
See the version list below for details.
dotnet add package UnquotedJson --version 1.0.7
NuGet\Install-Package UnquotedJson -Version 1.0.7
<PackageReference Include="UnquotedJson" Version="1.0.7" />
<PackageVersion Include="UnquotedJson" Version="1.0.7" />
<PackageReference Include="UnquotedJson" />
paket add UnquotedJson --version 1.0.7
#r "nuget: UnquotedJson, 1.0.7"
#:package UnquotedJson@1.0.7
#addin nuget:?package=UnquotedJson&version=1.0.7
#tool nuget:?package=UnquotedJson&version=1.0.7
UnquotedJson
UnquotedJson is a JSON parser. In addition to being able to parse the standard JSON format, UnquotedJson also allows unquoted strings which are keys and/or in values.
The quote signs of string may be omitted if shorten does not cause parsing ambiguity or errors.
The string must be quoted if a string is unquoted will causes parsing ambiguity or errors.
Format Convert
unquoted format convert to normal json format:
let x = """{
0:{index:0, license:t, nameSID:n, image:"img:left", descriptionSID:t, category:r}
}"""
let y =
x
|> JSON.parse
|> JSON.stringifyNormalJson
UnquotedJson is a superset of JSON, so the JSON.parse parsing function can directly parse normal JSON. follows code convert the normal format to unquoted json format:
let n = """{
"0":{"index":0,"license":"t","nameSID":"n","image":"img:left","descriptionSID":"t","category":"r"}
}"""
let y =
n
|> JSON.parse
|> JSON.stringifyUnquotedJson
Object Serialization
You can define serialization and deserialization functions for objects.
let serialize<'t> obj =
obj
|> JSON.read<'t>
|> JSON.stringifyNormalJson
let deserialize<'t> text =
text
|> JSON.parse
|> JSON.write<'t>
Here are some examples of serialization of common object types.
Tuple
(1,"x")
[1,"x"]
Array, list, Set and so on
[1;2;3]
[1,2,3]
Record
Supports serialization of anonymous records also.
{ name = "abcdefg"; age = 18 }
{"name":"abcdefg","age":18}
Map
Map [1,"1";2,"2"]
[[1,"1"],[2,"2"]]
Option
[Some 1;None]
[1,null]
Union
type UionExample =
| Zero
| OnlyOne of int
| Pair of int * string
[Zero;OnlyOne 1;Pair(2,"b")]
["Zero",{"OnlyOne":1},{"Pair":[2,"b"]}]
Provide tryRead and tryWrite to custom your convert rule
The signature of tryRead is:
tryRead:Type -> obj -> ((Type -> obj -> JsonValue) -> JsonValue) option
The signature of tryWrite is:
tryWrite:Type -> JsonValue -> ((Type -> JsonValue -> obj) -> obj) option
The usage see also FSharpConverter.fs
The return value of JSON.parse is JsonValue type that is a Discriminated Union type of F#.
UrlQuery
UnquotedJson can be used for query strings in URLs. When the field is of primitive type, the query string format is used. When the field is a complex type, use the Unqoted Json format.
The source see UrlQuery
The usage see also UrlQueryTest.fs
API
The main structure types are defined as follows:
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- FSharp.Core (>= 6.0.3)
- FSharp.Literals (>= 2.2.9)
- FslexFsyacc.Runtime (>= 1.2.9)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on UnquotedJson:
| Package | Downloads |
|---|---|
|
AspNetCore.UnquotedJson
ASP.NET Json serializer. |
|
|
ESTreeParser
A Parser for AST Descriptor Syntax of estree. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.1.0 | 216 | 9/3/2025 |
| 1.0.28 | 193 | 9/1/2025 |
| 1.0.27 | 304 | 6/9/2025 |
| 1.0.26 | 271 | 6/9/2025 |
| 1.0.25 | 206 | 6/6/2025 |
| 1.0.24 | 248 | 4/7/2025 |
| 1.0.23 | 255 | 4/7/2025 |
| 1.0.22 | 202 | 2/1/2025 |
| 1.0.21 | 226 | 7/22/2024 |
| 1.0.20 | 210 | 3/29/2024 |
| 1.0.19 | 206 | 3/8/2024 |
| 1.0.18 | 206 | 3/6/2024 |
| 1.0.17 | 218 | 1/11/2024 |
| 1.0.16 | 209 | 1/9/2024 |
| 1.0.15 | 220 | 12/29/2023 |
| 1.0.14 | 224 | 12/28/2023 |
| 1.0.13 | 231 | 9/9/2023 |
| 1.0.12 | 378 | 3/22/2023 |
| 1.0.11 | 406 | 12/21/2022 |
| 1.0.10 | 498 | 10/16/2022 |
| 1.0.8 | 539 | 5/21/2022 |
| 1.0.7 | 538 | 5/8/2022 |
| 1.0.6 | 681 | 3/14/2022 |
| 1.0.5 | 933 | 2/24/2022 |
| 1.0.4 | 554 | 1/24/2022 |
| 1.0.3 | 388 | 12/31/2021 |
| 1.0.2 | 440 | 12/19/2021 |
| 1.0.1 | 671 | 12/8/2021 |
| 1.0.0 | 461 | 12/6/2021 |
refac