skJson

Addon skJson 4.0.1-HOT-PATCHED

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

>[!IMPORTANT]
>Fixed mapping of nested variables

image


What's Changed
* Updated documentation by @EnolaK64 in https://github.com/cooffeeRequired/skJson/pull/105

New Contributors
* @EnolaK64 made their first contribution in https://github.com/cooffeeRequired/skJson/pull/105

Full Changelog: https://github.com/cooffeeRequired/skJson/compare/4.0.1...4.0.1-HOT-PATCHED

Big thanks to @rudde0, for reporting that issue and informing us
[!IMPORTANT]
## NEW FEATURES
All keys from json object by given path
>`coffeescript
>on script load:
set {_j} to json from "{data: {A: 'B', C: 'C', 'G': G}}"
send {_j}
set {keys::*} to all keys of "data" of {j}
send "&aKeys: %{_keys::*}%"
>`
>
Get filename from loopped file
>`coffeescript
>on script load:
loop all json files in dir "..." as files:
send "Filename: %loop-filename%"
send "File: %loop-file%"
>`

What's Changed
* Dev/fix api by @cooffeeRequired in https://github.com/cooffeeRequired/skJson/pull/102
* new features #1 by @cooffeeRequired in https://github.com/cooffeeRequired/skJson/pull/103


Full Changelog: https://github.com/cooffeeRequired/skJson/compare/4.0...4.0.1
[!NOTE]
Huge thanks to the guys who continue to diligently report bugs and test limits to the world of json - SkJson
@ExCorde
>
Big Shout Out to Them!

What's Changed
* Update 4.0 by @cooffeeRequired in https://github.com/cooffeeRequired/skJson/pull/98


Full Changelog: https://github.com/cooffeeRequired/skJson/compare/3.0.91...4.0
Full Changelog: https://github.com/cooffeeRequired/skJson/compare/3.0.7...3.0.91

[!IMPORTANT]
## BugFixes

[!NOTE]
Huge thanks to the guys who continue to diligently report bugs and test limits to the world of json - SkJson
@TrasonCo
@Val-K
@RlmUwU
>
Big Shout Out to Them!
Full Changelog: https://github.com/cooffeeRequired/skJson/compare/3.0.6...3.0.7

[!IMPORTANT]
## BugFixes
##### 1. Bug regarding bad parsing of nbt https://github.com/cooffeeRequired/skJson/issues/90
Code:
[quote][/quote]command /addtrade:
[quote][/quote]   permission: OP
[quote][/quote]   trigger:
[quote][/quote]      set {_jt} to json from file "plugins/SkJson/test.json" # this is my json file
[quote][/quote]       set {_slot0} to full nbt compound of slot 0 of player
[quote][/quote]       set {_slot1} to full nbt compound of slot 1 of player
[quote][/quote]       set {_slot2} to full nbt compound of slot 2 of player
[quote][/quote]       set {_n} to 0
>
[quote][/quote]       send {_jt} with pretty print to console
>
[quote][/quote]       write {_jt} to json file "plugins/SkJson/trader.json"
[quote][/quote]       loop values "trade::%{[i]n}%" of {[/i]jt}:
[quote][/quote]           send json-key to console
[quote][/quote]           set value of json object "trade::0::%{[i]n}%::0::nbt" in {[/i]jt} to {_slot0}
[quote][/quote]           set value of json object "trade::0::%{[i]n}%::1::nbt" in {[/i]jt} to {_slot1}
[quote][/quote]           set value of json object "trade::0::%{[i]n}%::2::nbt" in {[/i]jt} to {_slot2}
[quote][/quote]       write {_jt} to json file "plugins/SkJson/trader.json"
[quote][/quote]
>
At this point the nbt are converted successfully to the Object
Code:
[quote][/quote]         "nbt": {
[quote][/quote]          "..": "com.shanebeestudios.skbee.api.nbt.NBTContainer",
[quote][/quote]           "nbt": "{Count:1b,id:\"minecraft:stone\",tag:{CustomModelData:222,Damage:222,Enchantments:[{id:\"aqua[i]affinity\",lvl:1},{id:\"binding[/i]curse\",lvl:1},{id:\"vanishing_curse\",lvl:1}],RepairCost:2222,Tags:[\"Test\",\" test2\",\" test\"],display:{Lore:['[{\"text\":\"asdasdasdasd\",\"italic\":false}]'],Name:'[{\"text\":\"asdasdasd\",\"italic\":false}]'}}}"
[quote][/quote]         }
[quote][/quote]
##### 2. Bug regarding to wrong parsed http headers
Sometime could happen the Content-Type headers was broken, missing space or basically sending body to the GET request
That is already fixed, all headers could be used no matter what.
>
##### 3. Bug regarding to response types (JsonArray or Plain/Text)
The response of type JsonArray or Plain/Text was ignored, that's already fixed and sanitized!


[!NOTE]
## Add
##### ~ as path identifier of plugins/Skript/scripts
#### Example
Code:
[quote][/quote]on load:
[quote][/quote]   set {_file} to json from file "~/test.json"
[quote][/quote]   new json file "~/raw.json"
[quote][/quote]   send {_file}
[quote][/quote]
>
So the file will be created in the plugins/Skript/scripts

[!NOTE]
Huge thanks to the guys who continue to diligently report bugs and test limits to the world of json - SkJson
@PEX666
@kubaczak
@Boxic
@kitoxis
@DRAGNIL68
>
Big Shout Out to Them!
Full Changelog: https://github.com/cooffeeRequired/skJson/compare/3.0.5...3.0.6
[!IMPORTANT]
Fix reading json arrays from web requests.
Full Changelog: https://github.com/cooffeeRequired/skJson/compare/3.0.4...3.0.5

[!IMPORTANT]
Fix permission escalation for skjson command, now you need to have permission node skjson.use or op
Full Changelog: https://github.com/cooffeeRequired/skJson/compare/3.0.3...3.0.4

[!IMPORTANT]
## BugFixes
### 1. Bug regarding on editing files. with effect edit
>
Code:
[quote][/quote]command changefile:
>	trigger:
>		edit value "type" of json file "plugins/Skript/scripts/test.json" to "DIAMOND"
[quote][/quote]`
###### Before
Code:
[quote][/quote]changefile
[quote][/quote][08:28:42 INFO]: [SkJson] WARN Cannot create a file plugins/Skript/scripts/test.json cause the file already exists.
[quote][/quote]
#### 2. Bug regarding on sending web request on authorized apis (google, icloud, crypto stuff, and more)
What's Changed
* Switch from json serializaton to custom adapters by @SkJsonTeam in https://github.com/SkJsonTeam/skJson/pull/85
* Switch from json serializaton to custom adapters by @cooffeeRequired in https://github.com/SkJsonTeam/skJson/pull/89


Full Changelog: https://github.com/SkJsonTeam/skJson/compare/3.0.1...3.0.3


[!IMPORTANT]
## BugFixes
##### 1. Bug regarding bad encoding of ASCII characters https://github.com/SkJsonTeam/skJson/issues/88
Code:
[quote][/quote]local function ASCIISymbolsFix2[i]26[/i]24():
>	set {_json} to json from file "./plugins/Scripts/test.json"
>	send json from "»»»" to console
>	send {_json} with pretty print to console
[quote][/quote]
At this point the json file returned "B»B»B»" for some it was ~A"~A"~A"
This is already fixed.
>
##### 2. Bug regarding to completed resource handling for requests discord
Code:
[quote][/quote]local function requestSyncFix2[i]26[/i]24() :: object:
>	set {_request} to prepare new GET request on "https://raw.githubusercontent.com/SkJsonTeam/skJson/main/skjson.json"
>	set {_request}'s request content to @{"A": true}
>	set {_request}'s headers to @{"Content-Type": "application/json+vhd"}
>	sync send prepared {_request}
>
>	if response status of {_request} is "OK":
>		return response content of {_request}
[quote][/quote]
Fixed for now, working with web request is always meh, but if you really need to use synchronous request you can now use [:sync] (send|execute) [prepared] %request%
>
##### 3. Bug regarding to wrong parsing for value of %json% https://github.com/SkJsonTeam/skJson/issues/86
Now fully fixed
>
##### 4. Bug regarding to FileWriting https://github.com/SkJsonTeam/skJson/issues/84
Writing and formatting was handled by one method, which was not properly checked now fixed
>

[!NOTE]
Huge thanks to the guys who continue to diligently report bugs and test limits to the world of json - SkJson
@Envizar
@kubaczak
@ExCorde
@ImNotStable
@Pumkinhead
@MinecraftNight4
>
Big Shout Out to Them!
  • Like
Reactions: Envizar
Fix broken save json %string% For example, the operations for linking a file were error, fix (save json "..."), that will handle in the newest Skript version as World.
Fix cache - cache will be keep until reload/restart your server



Full Changelog: https://github.com/SkJsonTeam/skJson/compare/3.0.1...3.0.2-IO