-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Smithy RPC v2 trait definition and implementation #1583
Conversation
Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com>
smithy-protocols-traits/src/main/resources/META-INF/smithy/smithy.protocols.rpcv2.smithy
Show resolved
Hide resolved
smithy-protocols-traits/src/main/resources/META-INF/smithy/smithy.protocols.rpcv2.smithy
Outdated
Show resolved
Hide resolved
smithy-protocols-traits/src/main/resources/META-INF/smithy/smithy.protocols.rpcv2.smithy
Outdated
Show resolved
Hide resolved
smithy-protocols-traits/src/main/resources/META-INF/smithy/smithy.protocols.rpcv2.smithy
Show resolved
Hide resolved
smithy-protocols-traits/src/main/resources/META-INF/smithy/smithy.protocols.rpcv2.smithy
Outdated
Show resolved
Hide resolved
smithy-protocols-traits/src/main/resources/META-INF/smithy/smithy.protocols.rpcv2.smithy
Outdated
Show resolved
Hide resolved
smithy-protocols-traits/src/main/java/software/amazon/smithy/protocols/traits/package-info.java
Outdated
Show resolved
Hide resolved
...tocols-traits/src/main/java/software/amazon/smithy/protocols/traits/SmithyProtocolTrait.java
Outdated
Show resolved
Hide resolved
import software.amazon.smithy.model.shapes.ShapeId; | ||
import software.amazon.smithy.model.traits.AbstractTrait; | ||
|
||
public final class SmithyRpcV2Trait extends SmithyProtocolTrait { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Followup task: will need validation on at least one formats
entry, the value of the format(s), and the http
/eventStreamHttp
values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have fixed everything else in the meantime. This task will require me to understand a little bit more of smithy before being able to implement it. Do you want this to be part of this PR or should we address it in the next one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I have implemented the validator :) Now it just matter of writing a couple of tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am going to remove the Validator for now, so that we can start by shipping the trait.
...tocols-traits/src/main/java/software/amazon/smithy/protocols/traits/SmithyProtocolTrait.java
Outdated
Show resolved
Hide resolved
smithy-protocols-traits/src/main/java/software/amazon/smithy/protocols/traits/Rpcv2Trait.java
Outdated
Show resolved
Hide resolved
smithy-protocols-traits/src/main/java/software/amazon/smithy/protocols/traits/Rpcv2Trait.java
Outdated
Show resolved
Hide resolved
smithy-protocols-traits/src/main/java/software/amazon/smithy/protocols/traits/Rpcv2Trait.java
Outdated
Show resolved
Hide resolved
private final List<String> eventStreamHttp; | ||
private final List<String> format; | ||
|
||
public static final ShapeId ID = ShapeId.from("smithy.protocols#Rpcv2"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to be a lowercase rpcv2
to exactly match the name of the trait shape.
@@ -0,0 +1 @@ | |||
software.amazon.smithy.aws.traits.protocols.ProtocolHttpValidator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should remove this file as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I thought we could just piggy-back on this validator for http / httpStreaming. I'll remove it.
} | ||
|
||
/// A list of String shapes. | ||
list StringList { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: should be @private
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll fix it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Add Smithy RPC v2 trait definition and implementation Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Add support for wire formats * Address PR comments * Rename SmithyRpcV2* to just Rpcv2 * Finish refactor to just have Rpcv2 * Address PR comments. Remove the validator for now * Address comments from PR --------- Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com>
* Add Smithy RPC v2 trait definition and implementation Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Add support for wire formats * Address PR comments * Rename SmithyRpcV2* to just Rpcv2 * Finish refactor to just have Rpcv2 * Address PR comments. Remove the validator for now * Address comments from PR --------- Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com>
* Add Smithy RPC v2 trait definition and implementation Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Add support for wire formats * Address PR comments * Rename SmithyRpcV2* to just Rpcv2 * Finish refactor to just have Rpcv2 * Address PR comments. Remove the validator for now * Address comments from PR --------- Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com>
* Add Smithy RPC v2 trait definition and implementation Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Add support for wire formats * Address PR comments * Rename SmithyRpcV2* to just Rpcv2 * Finish refactor to just have Rpcv2 * Address PR comments. Remove the validator for now * Address comments from PR --------- Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com>
* Add Smithy RPC v2 trait definition and implementation Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Add support for wire formats * Address PR comments * Rename SmithyRpcV2* to just Rpcv2 * Finish refactor to just have Rpcv2 * Address PR comments. Remove the validator for now * Address comments from PR --------- Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com>
* Add Smithy RPC v2 trait definition and implementation Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Add support for wire formats * Address PR comments * Rename SmithyRpcV2* to just Rpcv2 * Finish refactor to just have Rpcv2 * Address PR comments. Remove the validator for now * Address comments from PR --------- Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com>
* Add Smithy RPC v2 trait definition and implementation Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Add support for wire formats * Address PR comments * Rename SmithyRpcV2* to just Rpcv2 * Finish refactor to just have Rpcv2 * Address PR comments. Remove the validator for now * Address comments from PR --------- Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com>
Description of changes:
This is the initial trait implementation for a new protocol, Smithy RPC v2.
More PRs will come, to add documentation and protocol tests. This will be merged against the
smithy-rpc-v2
branch to prevent pollutingmain
until this effort is concluded.@kstich for visibility.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.