Unverified Commit d4c23e3f authored by david-perez's avatar david-perez Committed by GitHub
Browse files

Bugfix: render server HTTP response code bindings again (#1207)

In 171d76fc, we regressed on HTTP response code binding in (non-error)
operation outputs. We made the call to obtain the `Writable`, but we
never wrote it with our writer.

In that commit, I inadvertently added the `RestJsonHttpResponseCode`
test (which was previoulsy passing) to the list of failing tests without
noticing the regression.
parent f7e1f083
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -650,7 +650,6 @@ class ServerProtocolTestGenerator(
            FailingTest(RestJson, "RestJsonFooErrorWithDunderType", TestType.Response),
            FailingTest(RestJson, "RestJsonFooErrorWithDunderTypeAndNamespace", TestType.Response),
            FailingTest(RestJson, "RestJsonFooErrorWithDunderTypeUriAndNamespace", TestType.Response),
            FailingTest(RestJson, "RestJsonHttpResponseCode", TestType.Response),
            FailingTest(RestJson, "RestJsonNoInputAndNoOutput", TestType.Response),
            FailingTest(RestJson, "RestJsonStreamingTraitsRequireLengthWithBlob", TestType.Response),
            FailingTest(RestJson, "RestJsonHttpWithEmptyBlobPayload", TestType.Request),
+1 −1
Original line number Diff line number Diff line
@@ -465,7 +465,7 @@ private class ServerHttpProtocolImplGenerator(
        Attribute.AllowUnusedMut.render(this)
        rustTemplate("let mut builder = #{http}::Response::builder();", *codegenScope)
        serverRenderResponseHeaders(operationShape)
        bindings.find { it.location == HttpLocation.RESPONSE_CODE }?.let { serverRenderResponseCodeBinding(it) }
        bindings.find { it.location == HttpLocation.RESPONSE_CODE }?.let { serverRenderResponseCodeBinding(it)(this) }

        operationShape.outputShape(model).findStreamingMember(model)?.let {
            val memberName = symbolProvider.toMemberName(it)