Loading codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/testutil/EventStreamTestModels.kt +5 −5 Original line number Diff line number Diff line Loading @@ -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) }, ), // Loading codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/transformers/ServerProtocolBasedTransformationFactory.kt +5 −1 Original line number Diff line number Diff line Loading @@ -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( Loading codegen-server/src/test/kotlin/software/amazon/smithy/rust/codegen/server/smithy/ConstraintsTest.kt +1 −1 Original line number Diff line number Diff line Loading @@ -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) } Loading Loading
codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/testutil/EventStreamTestModels.kt +5 −5 Original line number Diff line number Diff line Loading @@ -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) }, ), // Loading
codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/transformers/ServerProtocolBasedTransformationFactory.kt +5 −1 Original line number Diff line number Diff line Loading @@ -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( Loading
codegen-server/src/test/kotlin/software/amazon/smithy/rust/codegen/server/smithy/ConstraintsTest.kt +1 −1 Original line number Diff line number Diff line Loading @@ -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) } Loading