Add docs for to_json and from_json

This commit is contained in:
GenevensiS
2025-08-07 20:49:58 +02:00
parent 5fcc5a43fd
commit d3ed8fcaca
6 changed files with 43 additions and 2 deletions
+19
View File
@@ -0,0 +1,19 @@
Function: from_json
--Usage--
> from_json(some_JSON_string)
Convert a JSON string to a [[type:list]], a [[type:map]], a [[type:card]], a [[type:keyword]], a [[type:pack_type]] or a [[type:set]].
To see the required syntax, use an output of the [[fun:to_json]] function.
--Parameters--
! Parameter Type Description
| @input@ [[type:string]] JSON string to convert to an MSE script value.
| @set@ [[type:set]] The active set. This can be omited since "set" is a predefined variable.
--Examples--
> add_card_to_set(from_json("\{\"mse_object_type\":\"card\", \"data\":\{\"name\":\"Ajani\", \"rarity\":\"mythic rare\"\}\}"))
--See also--
| [[fun:to_json]] Convert an MSE script value to JSON text.