Closed
Conversation
- Enhanced CallOpenAPITaskFluent.document(String) to automatically detect whether the input is a literal URI or a JQ runtime expression
- Added EndpointUtil.isJqExpr() helper method to identify JQ expressions (strings starting with "${" )
- Added comprehensive test coverage with FuncOpenAPITest using MockWebServer
- Added serverlessworkflow-impl-openapi dependency to experimental/test module
- Updated .gitignore to exclude Bob-Shell notes directory
The document() method now intelligently handles both:
- Literal URI strings (e.g., "http://example.com/swagger.json")
- JQ runtime expressions (e.g., "${.openapi.url}")
This improves the developer experience by eliminating the need to choose between document(String) and document(URI) methods based on the input type.
Closes serverlessworkflow#1303
Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates how fluent builders represent HTTP/OpenAPI endpoints (especially when authentication is present) by moving endpoint expressions/URIs into EndpointConfiguration.uri (EndpointUri) and aligning tests accordingly. It also adds an experimental functional test for OpenAPI execution and updates test dependencies.
Changes:
- Refactor endpoint construction to populate
EndpointConfiguration.uri(literal vs expression) when auth is configured. - Update multiple DSL/unit tests to assert against
EndpointConfiguration.uri.*EndpointURIinstead ofEndpoint.runtimeExpression/Endpoint.uriTemplatein auth-related cases. - Add an experimental OpenAPI functional test using
MockWebServerand wire required test dependencies.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| fluent/spec/src/test/java/io/serverlessworkflow/fluent/spec/dsl/CallOpenApiDslTest.java | Update assertion to validate document endpoint expression via EndpointConfiguration.uri. |
| fluent/spec/src/test/java/io/serverlessworkflow/fluent/spec/dsl/CallHttpAuthDslTest.java | Update endpoint-expression assertions to validate ExpressionEndpointURI under auth. |
| fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/spi/EndpointUtil.java | Extend endpoint parsing to build EndpointConfiguration + EndpointUri when auth is provided. |
| fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/spi/CallOpenAPITaskFluent.java | Use EndpointUtil for document endpoints (string overloads) and avoid rebuilding auth twice. |
| fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/spi/CallHttpTaskFluent.java | Route auth-enabled string endpoints through EndpointUtil.fromString(expr, auth). |
| experimental/test/src/test/java/io/serverlessworkflow/fluent/test/FuncOpenAPITest.java | New functional test exercising OpenAPI document loading + operation invocation. |
| experimental/test/pom.xml | Add test dependency on serverlessworkflow-impl-openapi (and mark impl-jq as test scope). |
| experimental/fluent/func/src/test/java/io/serverlessworkflow/fluent/func/FuncDSLTest.java | Update auth-related endpoint assertions to validate EndpointConfiguration.uri.literalEndpointURI. |
| .gitignore | Normalize .vscode/ entry and ignore .bob/notes/. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: fjtirado <ftirados@redhat.com>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Many thanks for submitting your Pull Request ❤️!
What this PR does / why we need it:
Special notes for reviewers:
Additional information (if needed):