{{ message }}
This repository was archived by the owner on Nov 5, 2024. It is now read-only.
HTTPTarget improvements#1391
Merged
Merged
Conversation
Member
Author
Member
|
|
Member
Author
8b13738 to
d1d3567
Compare
odacremolbap
approved these changes
Apr 17, 2023
tzununbekov
added a commit
that referenced
this pull request
Apr 18, 2023
* HTTPTarget improvements * HTTPTarget Accepted event schema and type added
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

HTTPTarget improvements:
stringtojson.RawMessageto handle JSON data. The use-case to reproduce the issue is simple: Webhook source -> Transformation -> HTTP Target. Transformation in this context can either shift the whole Webhook payload to thebodykey or compose it from the multiple values of the source event. In both cases, the resultingbodywill be a JSON object, which is expected transformation behavior. Before this update, the target adapter complained about it:json: cannot unmarshal object into Go struct field RequestData.body of type string,spec.response.*parameters are not required and without them the adapter fails to send back the responses (CE context validation). Default values for CE type and source attributes are added,EventSourceandEventReceiverinterfaces to comply with the rest of the components. Resource's status exposes expected and produced CE attributes.Upd:
4. Since the target's expected event has a rather strict format requirement, JSON schema was added to explicitly announce the request contract. The target adapter requires an incoming event to be of
io.triggermesh.http.requesttype, otherwise event processing will fail.