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

feat(client): reduce generated HTTP request header code size #4594

Merged
merged 2 commits into from
Apr 12, 2023

Conversation

AndrewFossAWS
Copy link
Contributor

@AndrewFossAWS AndrewFossAWS commented Mar 30, 2023

Description

This PR reduces generated HTTP request header code size.

Before:

  const headers: __HeaderBag = {
    "content-type": "application/x-amz-json-1.1",
    "x-amz-target": "ACMPrivateCA.CreateCertificateAuthority",
  };

After:
(With operation name)

function sharedHeaders(operation: string): __HeaderBag {
  return {
    "content-type": "application/x-amz-json-1.1",
    "x-amz-target": "ACMPrivateCA.${operation}",
  };
}

const headers: __HeaderBag = sharedHeaders("CreateCertificateAuthority");

(Without operation name)

const SHARED_HEADERS: __HeaderBag = {
  "content-type": "application/x-www-form-urlencoded",
};

const headers: __HeaderBag = SHARED_HEADERS;

Testing

yarn test:all

Additional context

Add any other context about the PR here.


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

@AndrewFossAWS AndrewFossAWS requested a review from a team as a code owner March 30, 2023 05:07
@AndrewFossAWS AndrewFossAWS changed the title feat(client): refactor HTTP request code generation feat(client): reduce generated HTTP request header code size Mar 30, 2023
codegen/gradle.properties Outdated Show resolved Hide resolved
@@ -1,2 +1,2 @@
smithyVersion=1.28.1
smithyVersion=1.30.0
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it'd be helpful to mention in the description that this is bumping the Smithy version to 1.30.0.

@AndrewFossAWS AndrewFossAWS merged commit fe91123 into aws:main Apr 12, 2023
@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 27, 2023
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.

3 participants