-
Notifications
You must be signed in to change notification settings - Fork 68
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
UrlForm decoding support #1113
UrlForm decoding support #1113
Changes from 1 commit
7ab3c8d
e20d0d3
5d0e251
7accb71
c4d1ae6
bc174d2
a5fc091
5ceae82
e2466f5
679c682
c100080
e99c5cb
06cf841
e1c8cd0
149f826
b60496d
83d6d3c
a96480c
2701b0f
5ac670f
1f43fd4
ddb8f30
4ed323e
0e97a74
9068eae
4a42267
ecfbeee
7f9e8d0
58d39eb
40b6754
ed9b4dc
e4337de
841fa69
eccb3b7
824c479
dfe3eb2
ffba6d7
e8d0a89
8c081b6
e28d74d
18a723d
b0ad4eb
033173c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,8 +16,4 @@ | |
|
||
package smithy4s | ||
|
||
private[smithy4s] trait ScalaCompat { | ||
implicit final class MapOps[K, V](val map: Map[K, V]) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Couldn't see this being used anywhere. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should I merge the 2.13 and 3 ScalaCompat versions under |
||
def mapToValues[W](f: V => W): Map[K, W] = map.view.mapValues(f).toMap | ||
} | ||
} | ||
private[smithy4s] trait ScalaCompat {} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,8 +16,4 @@ | |
|
||
package smithy4s | ||
|
||
private[smithy4s] trait ScalaCompat { | ||
implicit final class MapOps[K, V](val map: Map[K, V]) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Couldn't see this being used anywhere. |
||
def mapToValues[W](f: V => W): Map[K, W] = map.view.mapValues(f).toMap | ||
} | ||
} | ||
private[smithy4s] trait ScalaCompat {} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,9 +30,7 @@ private[http] class UrlFormDataDecoderSchemaVisitor( | |
// https://smithy.io/2.0/aws/protocols/aws-ec2-query-protocol.html?highlight=ec2%20query%20protocol#query-key-resolution. | ||
ignoreUrlFormFlattened: Boolean, | ||
capitalizeStructAndUnionMemberNames: Boolean | ||
) extends SchemaVisitor.Cached[UrlFormDataDecoder] | ||
with smithy4s.ScalaCompat { | ||
compile => | ||
) extends SchemaVisitor.Cached[UrlFormDataDecoder] { compile => | ||
|
||
override def primitive[P]( | ||
shapeId: ShapeId, | ||
|
@@ -49,6 +47,7 @@ private[http] class UrlFormDataDecoderSchemaVisitor( | |
} | ||
} | ||
|
||
@annotation.nowarn("msg=Unused import") | ||
override def collection[C[_], A]( | ||
shapeId: ShapeId, | ||
hints: Hints, | ||
|
@@ -74,6 +73,7 @@ private[http] class UrlFormDataDecoderSchemaVisitor( | |
// | ||
// We can't assume they were encoded in order. That's why we have to | ||
// then sort by index. | ||
import scala.collection.compat._ | ||
val groupedAndSortedCursors = values | ||
.collect { | ||
case formData @ UrlForm.FormData( | ||
|
@@ -88,11 +88,9 @@ private[http] class UrlFormDataDecoderSchemaVisitor( | |
index | ||
} | ||
.map { case (index, values) => | ||
UrlFormCursor( | ||
history, | ||
values | ||
UrlFormCursor(history, values).down( | ||
PayloadPath.Segment.Index(index) | ||
) | ||
.down(PayloadPath.Segment.Index(index)) | ||
} | ||
groupedAndSortedCursors | ||
.traverse[UrlFormDecodeError, A](memberDecoder.decode(_)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is and it isn't. The result of |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,8 +30,7 @@ import cats.kernel.Monoid | |
|
||
private[smithy4s] class XmlEncoderSchemaVisitor( | ||
val cache: CompilationCache[XmlEncoder] | ||
) extends SchemaVisitor.Cached[XmlEncoder] | ||
with smithy4s.ScalaCompat { compile => | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unused. |
||
) extends SchemaVisitor.Cached[XmlEncoder] { compile => | ||
|
||
def primitive[P]( | ||
shapeId: ShapeId, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't see this being used anywhere.