Skip to content
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

yaml deserialization content starting with '---' #32

Open
HoffiMuc opened this issue Aug 2, 2021 · 1 comment
Open

yaml deserialization content starting with '---' #32

HoffiMuc opened this issue Aug 2, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@HoffiMuc
Copy link

HoffiMuc commented Aug 2, 2021

if yaml starts with '---', e.g.:

---
USING_DNSMASQ_ON_HOST: true
DEPLOY_LOCALPATHSTORAGE: true
        val yamlConf = Yaml.decodeFromString(YamlConf.serializer(), File("conf.yml").readText())

result:

Exception in thread "main" net.mamoe.yamlkt.YamlDecodingException: Top-level decoder: illegal beginning token MULTILINE_LIST_FLAG on decoding class
---
^ at line 1, column 2

without the '---', line it works fine.

@Him188
Copy link
Owner

Him188 commented Aug 25, 2021

As a temporary workaround, please do removePrefix("---") before calling decodeFromString.

@Him188 Him188 added the enhancement New feature or request label Sep 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants