Skip to content

Call http using POST/PATCH/PUT methods without with.body throws IllegalArgumentException #1648

Description

@mcruzdev

When using Quarkus Flow and trying to define the following workflow via YAML:

document:
  dsl: 1.0.0
  namespace: guru-quarkus
  name: processPhotoWorkflowYaml
  version: 0.1.0
use:
  authentications:
    flowPhotosAuth:
      oauth2:
        authority: https://auth.flowphotos.io/realms/flowphotos
        grant: client_credentials
        client:
          id: '${ $secret.photoService.clientId }'
          secret: '${ $secret.photoService.clientSecret }'
        endpoints:
          token: /protocol/openid-connect/token
do:
  - processPhoto:
      call: http
      with:
        method: post
        endpoint:
          uri: 'https://photos.internal.flowphotos.io/api/photos/{photoId}/process'
          authentication:
            use: flowPhotosAuth
  - notifyPhotoProcessed:
      call: http
      with:
        method: post
        endpoint:
          uri: https://notifications.internal.flowphotos.io/api/notifications
          authentication:
            use: flowPhotosAuth

I received the following stacktrace:

Caused by: java.lang.IllegalArgumentException: Both object and str are null

The specification says that body is not a required field: https://github.com/open-workflow-specification/specification/blob/main/dsl-reference.md#http-call.

Expected behavior

Build the workflow via YAML without exception when setting an HTTP call (call: http) without body (with.body) when using POST, PATCH or PUT.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions