Skip to content

Commit

Permalink
Rename middlware stages to match ruby middleware names
Browse files Browse the repository at this point in the history
  • Loading branch information
alextwoods committed Jul 5, 2023
1 parent aa466a8 commit 0b7b26b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public static ApplicationTransport createDefaultHttpApplicationTransport() {

middleware.add(new Middleware.Builder()
.klass("Hearth::Middleware::Build")
.step(MiddlewareStackStep.SERIALIZE)
.step(MiddlewareStackStep.BUILD)
.operationParams((ctx, operation) -> {
Map<String, String> params = new HashMap<>();
params.put("builder",
Expand All @@ -140,21 +140,21 @@ public static ApplicationTransport createDefaultHttpApplicationTransport() {
!Streaming.isNonFiniteStreaming(
model, model.expectShape(operation.getInputShape(), StructureShape.class))
)
.step(MiddlewareStackStep.BUILD)
.step(MiddlewareStackStep.AFTER_BUILD)
.build()
);

middleware.add((new Middleware.Builder())
.klass("Hearth::HTTP::Middleware::ContentMD5")
.step(MiddlewareStackStep.BUILD)
.step(MiddlewareStackStep.AFTER_BUILD)
.operationPredicate(
(model, service, operation) -> operation.hasTrait(HttpChecksumRequiredTrait.class))
.build()
);

middleware.add((new Middleware.Builder())
.klass("Hearth::Middleware::Parse")
.step(MiddlewareStackStep.DESERIALIZE)
.step(MiddlewareStackStep.PARSE)
.operationParams((ctx, operation) -> {
Map<String, String> params = new HashMap<>();
params.put("data_parser",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
@SmithyUnstableApi
public enum MiddlewareStackStep {
INITIALIZE,
SERIALIZE,
BUILD,
AFTER_BUILD,
RETRY,
FINALIZE,
DESERIALIZE,
PARSE,
SEND;

@Override
Expand All @@ -40,12 +40,12 @@ public String toString() {
return "Initialize";
case RETRY:
return "Retry";
case SERIALIZE:
return "Serialize";
case BUILD:
return "Build";
case DESERIALIZE:
return "Deserialize";
case AFTER_BUILD:
return "AfterBuild";
case PARSE:
return "Parse";
case FINALIZE:
return "Finalize";
case SEND:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public List<ProtocolGenerator> getProtocolGenerators() {
public void modifyClientMiddleware(MiddlewareBuilder middlewareBuilder, GenerationContext context) {
Middleware requestId = (new Middleware.Builder())
.klass("Middleware::RequestId")
.step(MiddlewareStackStep.DESERIALIZE)
.step(MiddlewareStackStep.PARSE)
.rubySource("smithy-ruby-rails-codegen/middleware/request_id.rb")
.build();
middlewareBuilder.register(requestId);
Expand Down

0 comments on commit 0b7b26b

Please sign in to comment.