Skip to content

Fix #415 attachments payload's validity issue#416

Merged
seratch merged 1 commit intoslackapi:masterfrom
seratch:issue-415
Apr 2, 2020
Merged

Fix #415 attachments payload's validity issue#416
seratch merged 1 commit intoslackapi:masterfrom
seratch:issue-415

Conversation

@seratch
Copy link
Copy Markdown
Contributor

@seratch seratch commented Apr 2, 2020

Summary

This pull request fixes #415 where posting a message with attachments gets an error response from the server-side saying the attachments are invalid.

{
  "ok": false,
  "error": "invalid_attachments",
  "response_metadata": {
    "messages": [
      "[ERROR] invalid_keys"
    ]
  }
}

The reason of the error is that an attachment payload this library generates contains empty arrays for fields, mrkdwnIn, and actions by default. This pull request removes those default values from an attachment initialization.

Requirements (place an x in each [ ])

@seratch seratch added bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented project:slack-api-model project:slack-api-model labels Apr 2, 2020
@seratch seratch added this to the 1.0 milestone Apr 2, 2020
@seratch seratch self-assigned this Apr 2, 2020
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 2, 2020

Codecov Report

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

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #416      +/-   ##
============================================
- Coverage     83.92%   83.86%   -0.07%     
+ Complexity     2368     2367       -1     
============================================
  Files           249      249              
  Lines          6372     6372              
  Branches        578      578              
============================================
- Hits           5348     5344       -4     
- Misses          670      674       +4     
  Partials        354      354              
Impacted Files Coverage Δ Complexity Δ
.../src/main/java/com/slack/api/model/Attachment.java 100.00% <ø> (ø) 10.00 <0.00> (ø)
...pi/methods/metrics/impl/RedisMetricsDatastore.java 87.03% <0.00%> (-2.47%) 37.00% <0.00%> (-1.00%)

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 ff3daea...9b8999a. Read the comment docs.

@seratch seratch merged commit b09580b into slackapi:master Apr 2, 2020
@seratch seratch deleted the issue-415 branch April 2, 2020 02:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented project:slack-api-model project:slack-api-model

Projects

None yet

Development

Successfully merging this pull request may close these issues.

attachment .blocks results in invalid_attachments response

1 participant