Unverified Commit 0ae12fd9 authored by Zelda Hessler's avatar Zelda Hessler Committed by GitHub
Browse files

fix: accidental ser instead of deser (#757)

* fix: accidental ser instead of deser

* update: CHANGELOG
parent bef53826
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
vNext (Month Day, Year)
=======================
...

**New this week**

- :bug: Re-add missing deserialization operations that were missing because of a typo in `HttpBoundProtocolGenerator.kt`

v0.25 (October 7th, 2021)
=========================
+4 −3
Original line number Diff line number Diff line
@@ -76,6 +76,7 @@ private class HttpBoundProtocolTraitImplGenerator(
    private val runtimeConfig = codegenContext.runtimeConfig
    private val httpBindingResolver = protocol.httpBindingResolver
    private val operationSerModule = RustModule.private("operation_ser")
    private val operationDeserModule = RustModule.private("operation_deser")

    private val codegenScope = arrayOf(
        "ParseStrict" to RuntimeType.parseStrict(runtimeConfig),
@@ -165,7 +166,7 @@ private class HttpBoundProtocolTraitImplGenerator(
        val outputShape = operationShape.outputShape(model)
        val outputSymbol = symbolProvider.toSymbol(outputShape)
        val errorSymbol = operationShape.errorSymbol(symbolProvider)
        return RuntimeType.forInlineFun(fnName, operationSerModule) {
        return RuntimeType.forInlineFun(fnName, operationDeserModule) {
            Attribute.Custom("allow(clippy::unnecessary_wraps)").render(it)
            it.rustBlockTemplate(
                "pub fn $fnName(response: &#{http}::Response<#{Bytes}>) -> std::result::Result<#{O}, #{E}>",
@@ -237,7 +238,7 @@ private class HttpBoundProtocolTraitImplGenerator(
        val outputShape = operationShape.outputShape(model)
        val outputSymbol = symbolProvider.toSymbol(outputShape)
        val errorSymbol = operationShape.errorSymbol(symbolProvider)
        return RuntimeType.forInlineFun(fnName, operationSerModule) {
        return RuntimeType.forInlineFun(fnName, operationDeserModule) {
            Attribute.Custom("allow(clippy::unnecessary_wraps)").render(it)
            it.rustBlockTemplate(
                "pub fn $fnName(op_response: &mut #{operation}::Response) -> std::result::Result<#{O}, #{E}>",
@@ -263,7 +264,7 @@ private class HttpBoundProtocolTraitImplGenerator(
        val outputShape = operationShape.outputShape(model)
        val outputSymbol = symbolProvider.toSymbol(outputShape)
        val errorSymbol = operationShape.errorSymbol(symbolProvider)
        return RuntimeType.forInlineFun(fnName, operationSerModule) {
        return RuntimeType.forInlineFun(fnName, operationDeserModule) {
            Attribute.Custom("allow(clippy::unnecessary_wraps)").render(it)
            it.rustBlockTemplate(
                "pub fn $fnName(response: &#{http}::Response<#{Bytes}>) -> std::result::Result<#{O}, #{E}>",