smithy4s.PartialData
See thePartialData companion object
Data structure that can hold either the totality or a subset of a larger piece of data.
This can be used to reconcile bits of data that are coming from several locations, or to send a piece of data towards different locations.
For instance :
structure AB {
@httpPayload
@required
a: String,
@httpHeader("X-B")
@required
b: String
}
translates to this case class
case class AB(a: String, b: String)
.
However, codec derivation (performed by the SchemaVisitor mechanism in Smithy4s), does not let us easily solve for problem such as http message decoding, because of the notion of priority : the http body of a message should not be decoded if the metadata is not fully decoded first.
In order to solve for this, the PartialData type allows to momentarily store a subset of the fields of a case class so that it can be reconciled with other pieces of PartialData later on.
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
Members list
In this article