Skip to content

Harden OpenAPI server and parameter resolution - #1838

Open
mathecruz wants to merge 3 commits into
open-workflow-specification:mainfrom
mathecruz:issues/1831
Open

mathecruz wants to merge 3 commits into
open-workflow-specification:mainfrom
mathecruz:issues/1831

Conversation

@mathecruz

Copy link
Copy Markdown
Collaborator

Changes

  • getServers() uses schemes.stream().findFirst() with guarding for null
  • getParameters() reads now operation-level parameter and path-level parameter
  • Default to https in UnifiedOpenAPI.getServers() when a Swagger 2 document has a host but no schemes (previously threw NPE)

Closes #1831

Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>

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.

🟡 Changes recommended

Parameter inheritance and server overrides introduce request-execution failures through lost parameter references, same-name parameter collisions, unexpanded server variables, and unresolved relative URLs.

4 open issues
What changed in this PR

This PR hardens the SDK’s OpenAPI request resolution, addressing server selection and inherited parameter handling described in #1831.

Changes:

  • Default Swagger 2 servers to HTTPS when schemes is absent.
  • Merge path-level and operation-level parameters, with operation-level definitions taking precedence.
  • Honor OpenAPI 3 operation and path server overrides, with tests for precedence and parameter merging.
File Description
impl/​openapi/​src/​test/​java/​org/​openworkflow/​sdk/​impl/​executors/​openapi/​OperationDefinitionTest.java Adds tests for HTTPS fallback, parameter merging, and server precedence.
impl/​openapi/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​executors/​openapi/​UnifiedOpenAPI.java Guards missing schemes and models inherited parameters and server overrides.
impl/​openapi/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​executors/​openapi/​OperationDefinition.java Merges parameter definitions and selects servers by precedence.

Review effort: Balanced

Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
# Conflicts:
#	impl/core/src/main/java/org/openworkflow/sdk/impl/executors/openapi/OpenAPIExecutor.java
#	impl/core/src/test/resources/schema/openapi/parameter-refs.json
#	impl/core/src/test/resources/schema/swagger/parameter-refs.json
#	impl/test/src/test/java/org/openworkflow/sdk/impl/test/OpenAPITest.java
@mathecruz
mathecruz marked this pull request as ready for review November 13, 2026 14:36
Copilot AI balanced review requested due to automatic review settings November 13, 2026 14:36

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

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.

OpenAPI AI found bugs

3 participants