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

List not recursive for YamlWriter #30

Open
siddhartha-gadgil opened this issue Nov 9, 2017 · 1 comment
Open

List not recursive for YamlWriter #30

siddhartha-gadgil opened this issue Nov 9, 2017 · 1 comment

Comments

@siddhartha-gadgil
Copy link

When I define a custom YamlWriter, one for the list is not automatically generated. Here is a session (in an ammonite repl).

@ case object blah 
defined object blah

@ implicit object BlahWriter extends YamlWriter[blah.type]{
  def write(c: blah.type) = YamlObject(YamlString("blah") -> YamlString(1.toString))
  }  
defined object BlahWriter

@ blah.toYaml 
res4: YamlValue = YamlObject(Map(YamlString("blah") -> YamlString("1")))

@ List(blah, blah).toYaml 
cmd5.sc:1: Cannot find YamlWriter or YamlFormat type class for List[ammonite.$sess.cmd2.blah.type]
val res5 = List(blah, blah).toYaml
                            ^
Compilation Failed

I would be happy to submit a pull request fixing this if it is not fixed yet.

@siddhartha-gadgil
Copy link
Author

I see this is a trivial issue, the recursive definitions are only for a YamlFormat, not separately for a YamlReader or YamlWriter. Will add these.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant