java-commons/muscript-gson
JFronny e84f8adc88
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
docs: Document StandardLib and GsonLib functions for μScript users
2023-08-25 18:53:04 +02:00
..
src feat: introduce muscript-gson to support json parsing/writing from muScript and of muScript data from java 2023-08-25 16:24:28 +02:00
build.gradle.kts feat: introduce muscript-gson to support json parsing/writing from muScript and of muScript data from java 2023-08-25 16:24:28 +02:00
README.md docs: Document StandardLib and GsonLib functions for μScript users 2023-08-25 18:53:04 +02:00

μScript-gson

μScript-gson bridges the gap between μScript and commons-gson by supporting the serialization and deserialization of Dynamic to json and exposing this functionality to μScript scripts. The gson type adapters are automatically registered to any GsonHolder, but the μScript methods need to be added to your Scope manually via GsonLib.addTo(scope). Other than that, no setup is needed.

Exposed functions

signature description
toJson(src: any): string Serializes scr to json
fromJson(src: string): any Deserialized src into the appropriate μScript types