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

ISSUE[578] Add json bool configuration option to HTTP executor #656

Merged
merged 3 commits into from
Aug 9, 2024

Conversation

halalala222
Copy link
Contributor

HTTP executor supports writing the HTTP response in JSON format.

{
  "status_code": 200,
  "headers": [
    "xxx": "yyy"
  ],
  "body": {
    "some_field": "some_value"
  }
}

HTTP executor config
image
Result
image
image
image
image

Copy link
Collaborator

@yohamta yohamta left a comment

Choose a reason for hiding this comment

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

All looking great! Just left a comment for a minor change.

type httpJSONResult struct {
StatusCode int `json:"status_code"`
Headers map[string][]string `json:"headers"`
Body map[string]any `json:"body"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we consider changing the Body type to any because valid JSON can be arrays, primitives, or null, not just objects?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right, I didn't consider it thoroughly. Thank you for the reminder.

Copy link

codecov bot commented Aug 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 66.16%. Comparing base (2e422ed) to head (e7bc472).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #656   +/-   ##
=======================================
  Coverage   66.16%   66.16%           
=======================================
  Files          53       53           
  Lines        4156     4156           
=======================================
  Hits         2750     2750           
  Misses       1186     1186           
  Partials      220      220           

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3fe07ad...e7bc472. Read the comment docs.

Copy link
Collaborator

@yohamta yohamta left a comment

Choose a reason for hiding this comment

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

✨✨✨LGTM✨✨🚀, thank you very much!

@yohamta yohamta merged commit a10fff5 into dagu-org:main Aug 9, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants