Open guymguym opened 3 years ago
Hello, thanks for submitting the issue! Currently the codegen-server supports only a subset of restJson1 protocol. We are working hard to first finish the support for this protocol and for the runtime needed to spawn and handle a full service.
We have plans to support all the wire protocols offered by Smithy, but unfortunately I don't have a timeline for when restXml will be added.
To give a little bit more context in what is needed to support restXml:
1) Implement the protocol specification in server-codegen
: this is done-ish in https://github.com/awslabs/smithy-rs/commit/6184024648bfd5119da7ecf9e471e6f0b1f89d43
2) Implement server specific serializer methods: https://github.com/awslabs/smithy-rs/blob/main/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/protocols/serialize/XmlBindingTraitSerializerGenerator.kt#L192-L199
3) Implement server specific deserializer methods: https://github.com/awslabs/smithy-rs/blob/main/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/protocols/parse/XmlBindingTraitParserGenerator.kt#L246-L248
4) Add the restXml ContentType
parsing support in the runtime: https://github.com/awslabs/smithy-rs/blob/main/rust-runtime/aws-smithy-http-server/src/protocols.rs#L11
5) Use the right ContentType
parsing in ServerHttpProtocolGenerator: https://github.com/awslabs/smithy-rs/blob/main/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/protocols/ServerHttpProtocolGenerator.kt#L493
Hey @crisidev Would it be welcome if I attempt to make a PR on this? BTW I wonder if the input/output/error types are shared with the client codegen? or are completely separate? I was looking for a way to convert a server request to a client request too and back...
PRs are of course super welcome! I will check and comment on your work tomorrow! Thanks a million for your contribution
re: input / output shapes: They're completely separate because the backwards compatibility guarantees around server types are actually different from those on the client types (you can have old clients, but not old servers, generally).
Generating converters, however, would be an interesting thing to add (and easy to code generate)
This is a low priority item as restXml
is not a modern protocol. Are you still interested in using this protocol?
It looks like nobody is interested in supporting restXml
in the server. We are leaning towards removing the existing initial support.
yeah it seems like supporting S3 would be the main reason (but it seems like that mostly uses custom code anyway)
Hi
I was trying to run codegen-server-test for S3 but it fails with the following message:
No matching protocol — service offers: [aws.protocols#restXml]. We offer: [aws.protocols#restJson1]
Is there a plan to support server codegen for restXml? I am new to the project so I might have used it incorrectly, so I am pasting my diffs and commands below. TIA
Here is the diffs over v0.30.0-alpha:
This is the output of running gradle: