-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Schema gets weird \" escapes from Yaml parsing #53
Comments
Okay, I've confirmed that if the yaml parser fails (as it does on the github example), then everything goes well. If the yaml parser succeeds it escapes my strings. |
The github example fails on:
Mine clears as yaml just fine unfortunately and gets escaped. |
Or rather, the quotes are kept around for some reason. The quotes are there inside of Yaml.Decode.String which is used in yamlToJsonDecoder. |
Now checks if the input filepath ends with .json giving the user a way to avoid the Yaml parser as it can do very strange things to the JSON values as noted in issue wolfadex#53.
This definitely is a weird bug. By chance would you be able to see if https://package.elm-lang.org/packages/MaybeJustJames/yaml/latest/ has the same parsing issue? I'm looking to switch to it as part of issue #38. Being able to resolve 2 bugs with 1 fix would be nice. |
Oh yeah, it reproduces up to latest main on the yaml-package. But I think my PR is a reasonably harmless fix. |
Now checks if the input filepath ends with .json giving the user a way to avoid the Yaml parser as it can do very strange things to the JSON values as noted in issue wolfadex#53.
Release version Looking through the build in dist it does not contain the string ".json" which it does if I force a build locally. @wolfadex probably something to look at :) |
Sorry about that. I forgot to build before publishing (I should set that up so I don't forget again in the future). I've published |
Sweet, thanks. Confirmed working. |
I have no idea why this happens on my schema and not on the github-spec.json. But it is consistent:
Removing the option for yaml and forcing a simple Json.decode works great.
Running the code as is gives this:
The text was updated successfully, but these errors were encountered: