Commit 5bbfdc2e authored by Fahad Zubair's avatar Fahad Zubair
Browse files

Add comments to clarify that the ServerProtocolBasedTransformationFactory...

Add comments to clarify that the ServerProtocolBasedTransformationFactory class will be removed later on
parent c36dfb0f
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -170,11 +170,11 @@ object EventStreamTestModels {
                mediaType = "application/cbor",
                responseContentType = "application/cbor",
                eventStreamMessageContentType = "application/cbor",
                validTestStruct = base64Encode(createCBORFromJSON(restJsonTestCase.validTestStruct)),
                validMessageWithNoHeaderPayloadTraits = base64Encode(createCBORFromJSON(restJsonTestCase.validMessageWithNoHeaderPayloadTraits)),
                validTestUnion = base64Encode(createCBORFromJSON(restJsonTestCase.validTestUnion)),
                validSomeError = base64Encode(createCBORFromJSON(restJsonTestCase.validSomeError)),
                validUnmodeledError = base64Encode(createCBORFromJSON(restJsonTestCase.validUnmodeledError)),
                validTestStruct = base64Encode(createCborFromJson(restJsonTestCase.validTestStruct)),
                validMessageWithNoHeaderPayloadTraits = base64Encode(createCborFromJson(restJsonTestCase.validMessageWithNoHeaderPayloadTraits)),
                validTestUnion = base64Encode(createCborFromJson(restJsonTestCase.validTestUnion)),
                validSomeError = base64Encode(createCborFromJson(restJsonTestCase.validSomeError)),
                validUnmodeledError = base64Encode(createCborFromJson(restJsonTestCase.validUnmodeledError)),
                protocolBuilder = { RpcV2Cbor(it) },
            ),
            //
+5 −1
Original line number Diff line number Diff line
@@ -24,8 +24,12 @@ import software.amazon.smithy.utils.ToSmithyBuilder

/**
 * Each protocol may not support all of the features that Smithy allows. For instance, `rpcv2Cbor`
 * does not support HTTP bindings. `ServerProtocolBasedTransformationFactory` is a factory
 * does not support HTTP bindings other than `@httpError`. `ServerProtocolBasedTransformationFactory` is a factory
 * object that transforms the model and removes specific traits based on the protocol being instantiated.
 *
 * In the long term, this class will be removed, and each protocol should be resilient enough to ignore extra
 * traits that the model is annotated with. This will be addressed when we fix issue
 * [#2979](https://github.com/smithy-lang/smithy-rs/issues/2979).
 */
object ServerProtocolBasedTransformationFactory {
    fun transform(
+1 −1
Original line number Diff line number Diff line
@@ -53,9 +53,9 @@ fun loadSmithyConstraintsModelForProtocol(modelProtocol: ModelProtocol): Pair<Mo
 */
fun loadSmithyConstraintsModel(): Pair<Model, ShapeId> {
    val filePath = "../codegen-core/common-test-models/constraints.smithy"
    val serviceShapeId = ShapeId.from("com.amazonaws.constraints#ConstraintsService")
    val model =
        File(filePath).readText().asSmithyModel()
    val serviceShapeId = model.shapes().filter { it.isServiceShape }.findFirst().orElseThrow().id
    return Pair(model, serviceShapeId)
}