Skip to content

Introduce query methods to DSL#1312

Merged
fjtirado merged 2 commits intoserverlessworkflow:mainfrom
mcruzdev:issue-1301
Apr 15, 2026
Merged

Introduce query methods to DSL#1312
fjtirado merged 2 commits intoserverlessworkflow:mainfrom
mcruzdev:issue-1301

Conversation

@mcruzdev
Copy link
Copy Markdown
Collaborator

@mcruzdev mcruzdev commented Apr 14, 2026

Changes

This pull request introduces enhanced support for HTTP query parameters in the fluent API, allowing for more flexible and expressive ways to define queries in workflow tasks. It adds new overloads for the query method, improves query parameter merging, and includes comprehensive test coverage for these scenarios.

Fluent API Enhancements:

  • Added overloads for the query method in BaseCallHttpSpec, allowing users to specify query parameters as a single string, a map, or a key-value pair. This makes it easier to construct HTTP queries in different formats.
  • Improved the implementation of the query method in CallHttpTaskFluent to merge new query parameters with existing ones, ensuring that multiple calls to query accumulate parameters rather than overwrite them.

Testing Improvements:

  • Added a comprehensive new test class, FuncHttpTest.java, that covers various scenarios for using the query method, including single and multiple parameters, maps, expressions, empty maps, special characters, and combinations with headers.
  • Expanded the WorkflowBuilderTest to include a test for the new query(String, String) overload, verifying that single key-value queries are correctly handled.

Closes #1301

Copilot AI review requested due to automatic review settings April 14, 2026 01:43
@mcruzdev mcruzdev requested a review from fjtirado as a code owner April 14, 2026 01:43
@mcruzdev
Copy link
Copy Markdown
Collaborator Author

cc: @domhanak

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR expands the fluent HTTP DSL to support specifying query parameters via additional query(...) overloads and ensures repeated query configuration accumulates (merges) rather than overwrites, with added test coverage validating the new behaviors.

Changes:

  • Added query(...) overloads to BaseCallHttpSpec for expression, map, and single key/value usage.
  • Updated CallHttpTaskFluent query handling to merge new HTTP query params with any existing ones.
  • Added functional tests exercising query parameter construction/merging and updated an existing builder test.

Reviewed changes

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

Show a summary per file
File Description
fluent/spec/src/test/java/io/serverlessworkflow/fluent/spec/WorkflowBuilderTest.java Adds an assertion covering the new query(String, String) overload in the spec DSL tests.
fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/spi/CallHttpTaskFluent.java Implements query parameter merging by seeding builders from any existing HTTP query params.
fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/dsl/BaseCallHttpSpec.java Introduces new fluent query(...) overloads in the DSL surface.
experimental/test/src/test/java/io/serverlessworkflow/fluent/test/FuncHttpTest.java New functional tests validating query behavior against a mock HTTP server.
experimental/test/pom.xml Adds test dependencies needed for functional HTTP/query tests (MockWebServer, impl-http, Jersey, etc.).

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

Copilot AI review requested due to automatic review settings April 14, 2026 02:03
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

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


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

Copy link
Copy Markdown
Collaborator

@fjtirado fjtirado left a comment

Choose a reason for hiding this comment

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

Great work.
you just need to adress IA comments regarding the pom and imports

@ricardozanini ricardozanini self-requested a review April 14, 2026 18:16
Copy link
Copy Markdown
Collaborator

@fjtirado fjtirado left a comment

Choose a reason for hiding this comment

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

Some comments needs adressing, specially the one for the pom

Copilot AI review requested due to automatic review settings April 14, 2026 18:39
Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.


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

Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
@fjtirado fjtirado merged commit 9762d4a into serverlessworkflow:main Apr 15, 2026
3 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.

feat: implement query() for FuncCallHttpStep

3 participants