Skip to content
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 requestCompression trait #1748

Merged
merged 4 commits into from
Apr 25, 2023
Merged

Conversation

syall
Copy link
Contributor

@syall syall commented Apr 21, 2023

Issue #, if available:

N/A.


Description of changes:

This PR adds the requestCompression trait which indicates whether an operation supports compressed requests from clients to services.

Changes include:

  • Smithy trait definition corresponding Java class and validator (with tests)
  • Smithy specification that specifies the behavior and caveats of the trait
  • Protocol tests for the trait in AWS protocols.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@syall syall force-pushed the requestCompression-trait branch 2 times, most recently from 31bba1d to 9e2fa64 Compare April 21, 2023 23:20
@syall syall marked this pull request as ready for review April 22, 2023 22:49
@syall syall requested a review from a team as a code owner April 22, 2023 22:49
@syall syall force-pushed the requestCompression-trait branch from 9e2fa64 to 34b44c0 Compare April 24, 2023 05:50
@syall syall force-pushed the requestCompression-trait branch 2 times, most recently from 2068f33 to 108fb75 Compare April 25, 2023 14:04
@syall syall force-pushed the requestCompression-trait branch from 108fb75 to 4bcaa50 Compare April 25, 2023 17:12
Smithy clients MUST expose a setting ``REQUEST_MIN_COMPRESSION_SIZE_BYTES`` to
specify the minimum size in bytes that a request body should be to trigger
compression. The value MUST be a non-negative integer in the range ``0`` and
``10485760`` inclusive, and defaults to ``10240`` bytes. If the value is outside
Copy link
Contributor

Choose a reason for hiding this comment

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

I personally feel that adding a clarifying note about why we choose 10240 will be worth. Otherwise this feels like a magic number.

Steven Yuan added 2 commits April 25, 2023 10:38
Add support for the `requestCompression` trait. Operations with the
trait applied direct clients to compress requests sent to services and
set the corresponding encoding in the ``Content-Encoding`` header.
Add the `requestCompression` trait specification under behavior traits,
including client behavior, client implementation, and backward
compatibility.
@syall syall force-pushed the requestCompression-trait branch 2 times, most recently from 9fe9c03 to cf0539e Compare April 25, 2023 17:56
Steven Yuan added 2 commits April 25, 2023 11:01
Add protocol tests for the 6 AWS protocols:

- `restJson1`
- `awsJson1_0`
- `awsJson1_1`
- `restXml`
- `awsQuery`
- `ec2`
Add entry for Smithy LSP log.
@syall syall force-pushed the requestCompression-trait branch from cf0539e to f06d572 Compare April 25, 2023 18:01
@syall syall merged commit 013989d into smithy-lang:main Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants