Skip to content

Add HTTP method shortcuts and output expression support in DSL#1458

Open
matheusandre1 wants to merge 1 commit into
serverlessworkflow:mainfrom
matheusandre1:issue1435
Open

Add HTTP method shortcuts and output expression support in DSL#1458
matheusandre1 wants to merge 1 commit into
serverlessworkflow:mainfrom
matheusandre1:issue1435

Conversation

@matheusandre1

Copy link
Copy Markdown
Contributor

Many thanks for submitting your Pull Request ❤️!

What this PR does / why we need it:
Closes: #1435
Special notes for reviewers:

Additional information (if needed):

@matheusandre1 matheusandre1 marked this pull request as ready for review June 12, 2026 21:51
@matheusandre1 matheusandre1 requested a review from fjtirado as a code owner June 12, 2026 21:51
Copilot AI review requested due to automatic review settings June 12, 2026 21:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds fluent DSL extensions for HTTP call tasks (HTTP verb shortcuts, headers/content-type helpers, redirect flag, post-configuration via andThen, and outputAs) and introduces tests to validate the new behavior.

Changes:

  • Added HTTP verb shortcut methods and convenience helpers (redirect, accept/content-type shortcuts) to the HTTP DSL.
  • Added andThen(...) support on CallHttpSpec to apply additional builder modifications.
  • Added outputAs(String) convenience method on CallHttpTaskBuilder and comprehensive JUnit tests for the new DSL features.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
fluent/spec/src/test/java/io/serverlessworkflow/fluent/spec/dsl/CallHttpDslExtensionsTest.java Adds unit tests covering new HTTP DSL shortcuts, chaining with andThen, and outputAs.
fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/dsl/CallHttpSpec.java Implements andThen(...) by storing additional steps to apply to the builder.
fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/dsl/BaseCallHttpSpec.java Adds HTTP verb shortcuts and convenience methods for redirect and common headers.
fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/CallHttpTaskBuilder.java Adds a convenience outputAs(String) method with Javadoc.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +125 to +148
default SELF PUT() {
steps().add(c -> c.method("PUT"));
return self();
}

default SELF DELETE() {
steps().add(c -> c.method("DELETE"));
return self();
}

default SELF PATCH() {
steps().add(c -> c.method("PATCH"));
return self();
}

default SELF HEAD() {
steps().add(c -> c.method("HEAD"));
return self();
}

default SELF OPTIONS() {
steps().add(c -> c.method("OPTIONS"));
return self();
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The default style for this class is uppercase.

Signed-off-by: Matheus André <matheusandr2@gmail.com>
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.

Add Fluent DSL Equivalents for HTTP Call Workflows

2 participants