Skip to content
This repository has been archived by the owner on May 21, 2018. It is now read-only.

Wrong extracting of XML list nodes #264

Open
mielientiev opened this issue Jan 30, 2017 · 0 comments
Open

Wrong extracting of XML list nodes #264

mielientiev opened this issue Jan 30, 2017 · 0 comments
Assignees

Comments

@mielientiev
Copy link
Collaborator

Issue:
Wrong extracting of XML list nodes

Example:
xml"""<a><b>1</b><b>2</b><b>23</b></a> """.b.as[List[Int]] // List[Int](1, 2, 23); - is ok
xml"""<a><b>1</b><b>2</b><b>23</b></a> """.b.as[List[String]] // List[String](1, 2, 23); - not ok
xml"""<a><b>1</b><b>2</b></a> """.b.as[Int] //res2: Int = 12 - not ok
xml"""<a><b>1</b><b>2</b></a> """.b.as[String] //res2: String = 12 - not ok

Expected:
xml"""<a><b>1</b><b>2</b><b>23</b></a> """.b.as[List[String]] should lead to rapture.json.TypeMismatchException:t ype mismatch: Expected string but found number

xml"""<a><b>1</b><b>2</b></a> """.b.as[Int] should lead to rapture.xml.TypeMismatchException: type mismatch: Expected number but found array

xml"""<a><b>1</b><b>2</b></a> """.b.as[String] should lead to rapture.xml.TypeMismatchException: type mismatch: Expected string but found array

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

No branches or pull requests

1 participant