Skip to content

chore: remove bodyParams from restJson serInputDocument #1177

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

Conversation

trivikr
Copy link
Member

@trivikr trivikr commented May 13, 2020

Issue #, if available:
Similar to #1153

Description of changes:
remove bodyParams from restJson serInputDocument

  • simple case
    • Before
    const bodyParams: any = {};
    if (input.analyzerArn !== undefined) {
      bodyParams["analyzerArn"] = input.analyzerArn;
    }
    if (input.resourceArn !== undefined) {
      bodyParams["resourceArn"] = input.resourceArn;
    }
    body = JSON.stringify(bodyParams);
    • After
    body = JSON.stringify({
      ...(input.analyzerArn !== undefined && { analyzerArn: input.analyzerArn }),
      ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn })
    });
  • with IdempotencyTokenTrait
    • Before
    const bodyParams: any = {};
    if (input.clientToken === undefined) {
      input.clientToken = generateIdempotencyToken();
    }
    if (input.clientToken !== undefined) {
      bodyParams["clientToken"] = input.clientToken;
    }
    if (input.filter !== undefined) {
      bodyParams["filter"] = serializeAws_restJson1_1FilterCriteriaMap(
        input.filter,
        context
      );
    }
    if (input.ruleName !== undefined) {
      bodyParams["ruleName"] = input.ruleName;
    }
    body = JSON.stringify(bodyParams);
    • After
    body = JSON.stringify({
      clientToken: input.clientToken ?? generateIdempotencyToken(),
      ...(input.filter !== undefined && {
        filter: serializeAws_restJson1_1FilterCriteriaMap(input.filter, context)
      }),
      ...(input.ruleName !== undefined && { ruleName: input.ruleName })
    });

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

@aws-sdk-js-automation
Copy link

AWS CodeBuild CI Report

  • CodeBuild project: sdk-staging-test
  • Commit ID: 2c3569a
  • 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 Report

Merging #1177 into master will decrease coverage by 0.20%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1177      +/-   ##
==========================================
- Coverage   73.69%   73.48%   -0.21%     
==========================================
  Files         285      285              
  Lines       12549    12439     -110     
  Branches     2814     2814              
==========================================
- Hits         9248     9141     -107     
+ Misses       3301     3298       -3     
Impacted Files Coverage Δ
protocol_tests/aws-json/protocols/Aws_json1_1.ts 67.92% <ø> (-0.45%) ⬇️
...ol_tests/aws-restjson/protocols/Aws_restJson1_1.ts 62.99% <ø> (-1.57%) ⬇️
...rotocol_tests/aws-restxml/protocols/Aws_restXml.ts 67.31% <ø> (-0.50%) ⬇️

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 5f820e6...2c3569a. Read the comment docs.

@trivikr trivikr merged commit 3c8cd21 into aws:master May 13, 2020
@trivikr trivikr deleted the remove-bodyParams-restJson-serializeInputDocument branch May 13, 2020 16:54
@lock
Copy link

lock bot commented May 20, 2020

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 May 20, 2020
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