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

Move `RestRequestSpecGenerator` into `codegen-server` (#2537)

Move `RestRequestSpecGenerator` from `codegen-core` to `codegen-server`.
This can now be done thanks to the `ServerProtocol` interface.
parent 421488ef
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
 * SPDX-License-Identifier: Apache-2.0
 */

package software.amazon.smithy.rust.codegen.core.smithy.generators.http
package software.amazon.smithy.rust.codegen.server.smithy.generators.http

import software.amazon.smithy.model.shapes.OperationShape
import software.amazon.smithy.rust.codegen.core.rustlang.Writable
@@ -15,10 +15,6 @@ import software.amazon.smithy.rust.codegen.core.smithy.protocols.HttpBindingReso

/**
 * [RestRequestSpecGenerator] generates a restJson1 or restXml specific `RequestSpec`. Both protocols are routed the same.
 *
 * This class has to live in the `codegen-core` subproject instead of in the `codegen-server` subproject because it is used
 * by the implementations of the `serverRouterRequestSpec` of the [Protocol] interface, which is used by both subprojects
 * (even though only the `codegen-server` subproject calls `serverRouterRequestSpec`).
 */
class RestRequestSpecGenerator(
    private val httpBindingResolver: HttpBindingResolver,
+1 −1
Original line number Diff line number Diff line
@@ -14,7 +14,6 @@ import software.amazon.smithy.rust.codegen.core.rustlang.writable
import software.amazon.smithy.rust.codegen.core.smithy.CodegenContext
import software.amazon.smithy.rust.codegen.core.smithy.RuntimeConfig
import software.amazon.smithy.rust.codegen.core.smithy.RuntimeType
import software.amazon.smithy.rust.codegen.core.smithy.generators.http.RestRequestSpecGenerator
import software.amazon.smithy.rust.codegen.core.smithy.protocols.AwsJson
import software.amazon.smithy.rust.codegen.core.smithy.protocols.AwsJsonVersion
import software.amazon.smithy.rust.codegen.core.smithy.protocols.Protocol
@@ -32,6 +31,7 @@ import software.amazon.smithy.rust.codegen.server.smithy.ServerCargoDependency
import software.amazon.smithy.rust.codegen.server.smithy.ServerCodegenContext
import software.amazon.smithy.rust.codegen.server.smithy.ServerRuntimeType
import software.amazon.smithy.rust.codegen.server.smithy.canReachConstrainedShape
import software.amazon.smithy.rust.codegen.server.smithy.generators.http.RestRequestSpecGenerator
import software.amazon.smithy.rust.codegen.server.smithy.protocols.ServerAwsJsonSerializerGenerator
import software.amazon.smithy.rust.codegen.server.smithy.protocols.ServerRestJsonSerializerGenerator
import software.amazon.smithy.rust.codegen.server.smithy.targetCanReachConstrainedShape