Unverified Commit 31c152d9 authored by Burak's avatar Burak Committed by GitHub
Browse files

Unify Pokemon model for Rust and Python servers (#2700)

## Motivation and Context
Now we have the feature parity between Rust and Python servers (at least
for the Pokémon service's needs) we can use the same model in both.
Closes https://github.com/awslabs/smithy-rs/issues/1508

## Testing
```bash
$ cd smithy-rs/examples
$ make test # test Rust servers
$ cd python
$ make test # test Python servers
```

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [ ] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [ ] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
parent 040d0e42
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -93,8 +93,8 @@ val allCodegenTests = "../codegen-core/common-test-models".let { commonModels ->
            imports = listOf("$commonModels/naming-obstacle-course-structs.smithy"),
        ),
        CodegenTest("aws.protocoltests.json#TestService", "endpoint-rules"),
        CodegenTest("com.aws.example.rust#PokemonService", "pokemon-service-client", imports = listOf("$commonModels/pokemon.smithy", "$commonModels/pokemon-common.smithy")),
        CodegenTest("com.aws.example.rust#PokemonService", "pokemon-service-awsjson-client", imports = listOf("$commonModels/pokemon-awsjson.smithy", "$commonModels/pokemon-common.smithy")),
        CodegenTest("com.aws.example#PokemonService", "pokemon-service-client", imports = listOf("$commonModels/pokemon.smithy", "$commonModels/pokemon-common.smithy")),
        CodegenTest("com.aws.example#PokemonService", "pokemon-service-awsjson-client", imports = listOf("$commonModels/pokemon-awsjson.smithy", "$commonModels/pokemon-common.smithy")),
    )
}

+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@ $version: "1.0"
// This is a temporary model to test AwsJson 1.0 with @streaming.
// This model will be removed when protocol tests support @streaming.

namespace com.aws.example.rust
namespace com.aws.example

use aws.protocols#awsJson1_0
use smithy.framework#ValidationException
+19 −2
Original line number Diff line number Diff line
$version: "1.0"

namespace com.aws.example.rust
namespace com.aws.example

use aws.protocols#restJson1
use smithy.framework#ValidationException
@@ -20,7 +20,8 @@ service PokemonService {
        GetServerStatistics,
        DoNothing,
        CapturePokemon,
        CheckHealth
        CheckHealth,
        StreamPokemonRadio
    ],
}

@@ -146,3 +147,19 @@ structure MasterBallUnsuccessful {

@error("client")
structure ThrottlingError {}

/// Fetch a radio song from the database and stream it back as a playable audio.
@readonly
@http(uri: "/radio", method: "GET")
operation StreamPokemonRadio {
    output: StreamPokemonRadioOutput
}

@output
structure StreamPokemonRadioOutput {
    @httpPayload
    data: StreamingBlob
}

@streaming
blob StreamingBlob
 No newline at end of file
+2 −2
Original line number Diff line number Diff line
@@ -84,12 +84,12 @@ val allCodegenTests = "../codegen-core/common-test-models".let { commonModels ->
        CodegenTest("com.amazonaws.ebs#Ebs", "ebs", imports = listOf("$commonModels/ebs.json")),
        CodegenTest("com.amazonaws.s3#AmazonS3", "s3"),
        CodegenTest(
            "com.aws.example.rust#PokemonService",
            "com.aws.example#PokemonService",
            "pokemon-service-server-sdk",
            imports = listOf("$commonModels/pokemon.smithy", "$commonModels/pokemon-common.smithy"),
        ),
        CodegenTest(
            "com.aws.example.rust#PokemonService",
            "com.aws.example#PokemonService",
            "pokemon-service-awsjson-server-sdk",
            imports = listOf("$commonModels/pokemon-awsjson.smithy", "$commonModels/pokemon-common.smithy"),
        ),
+5 −1
Original line number Diff line number Diff line
@@ -41,7 +41,11 @@ dependencies {
val allCodegenTests = "../../codegen-core/common-test-models".let { commonModels ->
    listOf(
        CodegenTest("com.amazonaws.simple#SimpleService", "simple", imports = listOf("$commonModels/simple.smithy")),
        CodegenTest("com.aws.example.python#PokemonService", "pokemon-service-server-sdk"),
        CodegenTest(
            "com.aws.example#PokemonService",
            "pokemon-service-server-sdk",
            imports = listOf("$commonModels/pokemon.smithy", "$commonModels/pokemon-common.smithy"),
        ),
        CodegenTest(
            "com.amazonaws.ebs#Ebs", "ebs",
            imports = listOf("$commonModels/ebs.json"),
Loading