https://pulumi.com logo
#general
Title
# general
e

early-intern-90238

03/11/2020, 11:05 PM
do you think you guys can fix the bug where the parser doesn't work when import the xml with trailing commas, which is legal syntax?
it takes me literally like 5 seconds to fix
so more of a nuissance really
g

gentle-diamond-70147

03/11/2020, 11:23 PM
Can you link me to the issue on github? I'm not familiar with this bug.
e

early-intern-90238

03/11/2020, 11:24 PM
oh I didn't create one I just assumed it was known.
I'll create one.
But basically if you use beautify or beautify decides to auto format the xml you export from your stack...it appends a , to trailing elements.
it should be proper xml but the pulumi parser dies on it
g

gentle-diamond-70147

03/11/2020, 11:27 PM
I'm afraid I still don't follow... where is the XML coming from?
Do you mean JSON?
e

early-intern-90238

03/11/2020, 11:27 PM
oops i meant json lol
no idea why i said xml
g

gentle-diamond-70147

03/11/2020, 11:27 PM
Ah, hehe. Ok, makes more sense now.
So you're doing a
pulumi stack export
and then
pulumi stack import
is failing because of trailing commas on array elements?
e

early-intern-90238

03/11/2020, 11:28 PM
yes
g

gentle-diamond-70147

03/11/2020, 11:28 PM
Gotcha.
e

early-intern-90238

03/11/2020, 11:28 PM
I guess I could just update my formatter to remove those for json
g

gentle-diamond-70147

03/11/2020, 11:29 PM
Yea, I don't think this is "known" in the general sense. Please open an issue on github.
e

early-intern-90238

03/11/2020, 11:29 PM
ok
So based on this https://www.json.org/json-en.html it seems that may actually not be technically valid
even though the formatter does it...
So I think Pulumi might have it right...
nevermind...
bug in formatter, not pulumi...
👍 1
w

white-balloon-205

03/12/2020, 1:20 AM
Yeah - trailing commas are definitely not valid JSON. The are valid JavaScript, so if your formatted is treating the files as JS it might mis-format them?