Skip to content

Update HTTP binding protocol generation #465

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

Merged
merged 1 commit into from
Nov 25, 2019

Conversation

kstich
Copy link
Contributor

@kstich kstich commented Nov 22, 2019

This commit updates the support for aws.rest-json-1.1 to build atop
the refactor of protocol generation done in smithy-typescript. It
also introduces support for the aws.rest-json-1.0 protocol.

In doing so, general components were built atop the abstractions
provided. The aws.rest-json-1.* set of protocols serialize BigInteger
and BigDecimal shapes as JSON numbers on the wire, so an implementation
of the DocumentMember[Deser|Ser]Visitor was created to fail generation.
Implementations of the DocumentShape[Deser|Ser]Visitor classes are
also included to support serde of shapes in request and response
bodies.

A rest-json implementation of the HttpBindingProtocolGenerator has been
created to combine the above aspects and handling of document bodies.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@kstich kstich requested a review from mtdowling November 22, 2019 22:41
@aws-sdk-js-automation
Copy link

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@codecov-io
Copy link

codecov-io commented Nov 22, 2019

Codecov Report

Merging #465 into add-smithy-generator will increase coverage by 1.35%.
The diff coverage is n/a.

Impacted file tree graph

@@                   Coverage Diff                   @@
##           add-smithy-generator    #465      +/-   ##
=======================================================
+ Coverage                 95.15%   96.5%   +1.35%     
=======================================================
  Files                        80      72       -8     
  Lines                      1526    1231     -295     
  Branches                    301     224      -77     
=======================================================
- Hits                       1452    1188     -264     
+ Misses                       74      43      -31
Impacted Files Coverage Δ
packages/middleware-retry/src/configurations.ts
packages/middleware-retry/src/delayDecider.ts
packages/middleware-retry/src/retryMiddleware.ts
packages/middleware-retry/src/constants.ts
packages/middleware-signing/src/middleware.ts
packages/middleware-stack/src/MiddlewareStack.ts
packages/middleware-retry/src/defaultStrategy.ts
packages/middleware-retry/src/retryDecider.ts

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3e0ff2c...75ba8cb. Read the comment docs.

}

private String serializeToNumber() {
return "Number(" + getDataSource() + ")";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can Number actually contain an entire BigDecimal?

This commit updates the support for aws.rest-json-1.1 to build atop
the refactor of protocol generation done in smithy-typescript. It
also introduces support for the aws.rest-json-1.0 protocol.

In doing so, general components were built atop the abstractions
provided. The aws.rest-json-1.* set of protocols serialize BigInteger
and BigDecimal shapes as JSON numbers on the wire, so an implementation
of the DocumentMemberSerVisitor was created to fail generation.
Implementations of the [DocumentShape[Deser|Ser]Visitor classes are
also included to support serde of shapes in request and response
bodies.

A rest-json implementation of the HttpBindingProtocolGenerator has been
created to combine the above aspects and handling of document bodies.
@kstich kstich force-pushed the protocol_generator_refactor branch from 882df42 to 75ba8cb Compare November 25, 2019 20:58
@kstich kstich requested a review from mtdowling November 25, 2019 20:59
@aws-sdk-js-automation
Copy link

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@kstich kstich merged commit 45e08c8 into add-smithy-generator Nov 25, 2019
@kstich kstich deleted the protocol_generator_refactor branch November 25, 2019 21:02
kstich added a commit that referenced this pull request Nov 25, 2019
This commit updates the support for aws.rest-json-1.1 to build atop
the refactor of protocol generation done in smithy-typescript. It
also introduces support for the aws.rest-json-1.0 protocol.

In doing so, general components were built atop the abstractions
provided. The aws.rest-json-1.* set of protocols serialize BigInteger
and BigDecimal shapes as JSON numbers on the wire, so an implementation
of the DocumentMemberSerVisitor was created to fail generation.
Implementations of the [DocumentShape[Deser|Ser]Visitor classes are
also included to support serde of shapes in request and response
bodies.

A rest-json implementation of the HttpBindingProtocolGenerator has been
created to combine the above aspects and handling of document bodies.
@lock
Copy link

lock bot commented Dec 2, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants