-
Notifications
You must be signed in to change notification settings - Fork 46
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
RM API: provide useful feedback when trigger action is malformed #750
RM API: provide useful feedback when trigger action is malformed #750
Conversation
7505f2f
to
4a8e185
Compare
Codecov Report
@@ Coverage Diff @@
## release-1.1 #750 +/- ##
================================================
- Coverage 68.43% 46.00% -22.44%
================================================
Files 258 17 -241
Lines 5911 300 -5611
================================================
- Hits 4045 138 -3907
+ Misses 1866 162 -1704 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
4a8e185
to
5e56bfd
Compare
def encode( | ||
%Action{ | ||
http_url: http_url, | ||
http_method: http_method, | ||
http_static_headers: http_static_headers, | ||
template: template, | ||
template_type: template_type | ||
}, | ||
opts | ||
) | ||
when not is_nil(http_url) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extract only what is needed (i.e. http_url
) in the function head, and extract the rest in the body
%Action{ | ||
amqp_exchange: amqp_exchange, | ||
amqp_routing_key: amqp_routing_key, | ||
amqp_static_headers: amqp_headers, | ||
amqp_message_expiration_ms: amqp_message_expiration_ms, | ||
amqp_message_persistent: amqp_message_persistent, | ||
amqp_message_priority: amqp_message_priority | ||
}, | ||
opts | ||
) | ||
when not is_nil(amqp_exchange) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extract only what is needed (i.e. amqp_exchange
) in the function head, and extract the rest in the body
…ormed Display detailed feedback upon failed installation of a trigger with malformed action field. Under the hood, the Trigger changeset now embeds a Action changeset that wraps a valid AMQP/HTTP action. Validation is still performed by the two related modules. The Action modules handles JSON encoding/decoding, too. Signed-off-by: Arnaldo Cesco <arnaldo.cesco@secomind.com>
5e56bfd
to
83e6ac7
Compare
Display detailed feedback upon failed installation of a trigger with malformed action field.
Under the hood, the Trigger changeset now embeds an
Astarte.RealmManagement.API.Triggers.Action
changeset that wraps a valid AMQP/HTTP action. Data validation is still performed by the two related modules.The Action modules handles JSON encoding/decoding, too.
Fixes #748.