winglang / voting-app

MIT License
6 stars 4 forks source link

Fix Json.stringify parameters for use with newer versions of wing compiler #21

Closed whummer closed 1 year ago

whummer commented 1 year ago

Fix Json.stringify(..) parameters in sample, for use with newer versions of wing compiler:

$ wing compile --target tf-aws voting-app/main.w

error: Expected type to be "JsonStringifyOptions?", but got "num" instead
    --> voting-app/main.w:232:28
    |
232 |   log(Json.stringify(body, 2));
    |                            ^ Expected type to be "JsonStringifyOptions?", but got "num" instead

wing version:

$ wing --version
0.26.7

Another alternative would be to remove the parameter altogether, to make the sample code backward-compatible with older wing versions. Not sure what would be preferable from your perspective?


/cc @Chriscbr @skorfmann