Skip to content

Guard against null parameter fields in OpenAPI operation parsing#1453

Open
mcruzdev wants to merge 4 commits into
serverlessworkflow:mainfrom
mcruzdev:null-param-required-false
Open

Guard against null parameter fields in OpenAPI operation parsing#1453
mcruzdev wants to merge 4 commits into
serverlessworkflow:mainfrom
mcruzdev:null-param-required-false

Conversation

@mcruzdev

Copy link
Copy Markdown
Collaborator

Guard against null parameter fields in OpenAPI operation parsing

Add null checks before dereferencing Parameter.in() and Schema in
OperationDefinition, so parameters without an explicit "in" value or
schema no longer trigger NullPointerExceptions during parsing.

Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
@mcruzdev mcruzdev requested a review from fjtirado as a code owner June 11, 2026 19:59
Copilot AI review requested due to automatic review settings June 11, 2026 19:59

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.

This PR hardens OpenAPI/Swagger operation parameter handling by normalizing default values and adding null-safety around parameter fields during parameter extraction.

Changes:

  • Default UnifiedOpenAPI.Parameter.required to false when unspecified.
  • Add null checks for parameter.in() and schema when filtering/processing Swagger v2 body parameters.

Reviewed changes

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

File Description
impl/openapi/src/main/java/io/serverlessworkflow/impl/executors/openapi/UnifiedOpenAPI.java Normalizes Parameter.required to a non-null default (false).
impl/openapi/src/main/java/io/serverlessworkflow/impl/executors/openapi/OperationDefinition.java Adds null-safety when checking parameter location (in) and resolving schema refs.

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

@fjtirado fjtirado left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@mcruzdev Good.
Lets fix AI comments

mcruzdev added 2 commits June 11, 2026 17:29
Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
Copilot AI review requested due to automatic review settings June 12, 2026 15:43

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

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

Signed-off-by: Matheus Cruz <matheuscruz.dev@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.

3 participants