mirror of
https://github.com/IgorTimofeev/MineOS.git
synced 2025-12-20 19:19:21 +01:00
Updated JSON API (markdown)
parent
7dbf567e4f
commit
06f90289d8
24
JSON-API.md
24
JSON-API.md
@ -33,19 +33,19 @@ json.encode({
|
|||||||
Result:
|
Result:
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
> {
|
> "{
|
||||||
"testString": "hello world",
|
\"testString\": \"hello world\",
|
||||||
"testTable": {
|
\"testTable\": {
|
||||||
"testArray": [
|
\ "testArray\": [
|
||||||
1,
|
1,
|
||||||
2,
|
2,
|
||||||
3
|
3
|
||||||
],
|
],
|
||||||
"testNumber": 123,
|
\"testNumber\": 123,
|
||||||
"testBool": true,
|
\"testBool\": true,
|
||||||
"testNil": nil
|
\"testNil\": nil
|
||||||
}
|
}
|
||||||
}
|
}"
|
||||||
```
|
```
|
||||||
|
|
||||||
### json.**decode**(*string* data): *mixed* result
|
### json.**decode**(*string* data): *mixed* result
|
||||||
@ -55,7 +55,7 @@ Attempts to interpret given `data` string as JSON object and convert it to Lua t
|
|||||||
Example:
|
Example:
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
json.decode("{
|
json.decode({
|
||||||
\"test\": 123,
|
\"test\": 123,
|
||||||
\"hello\": \"world\"
|
\"hello\": \"world\"
|
||||||
}")
|
}")
|
||||||
@ -64,8 +64,8 @@ json.decode("{
|
|||||||
Result:
|
Result:
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
> "{
|
> {
|
||||||
test = 123,
|
test = 123,
|
||||||
hell = "world"
|
hello = "world"
|
||||||
}"
|
}
|
||||||
```
|
```
|
||||||
Loading…
x
Reference in New Issue
Block a user