Closed mauhiz closed 9 years ago
Thanks for raising this. Yes this is a problem with operator order. I think "resource"
is parsed a full URI, but need to investigate further. (see #46 which also mentions this bug). I want to improve the DSL to fix this, but you are right, we should document this until then. Added to README.md
I see, indeed #46 is quite close to what is happening here.
This has now been properly fixed in 0.4.10-SNAPSHOT
:
"http://host" / "path" / "to" / "resource" ? ("a" -> "1" ) & ("b" -> "2")
res0: com.netaporter.uri.Uri = http://host/path/to/resource?a=1&b=2
a uri defined with the dsl can lead to surprising results :
As I understand it this is because of Scala operator precedence : & then / then ? and because the & operator is not defined for Tuple2, even with the dsl.
From there two options :