Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ 馃殌 Feature]: Java 18.0 runtime payload parsing is only possible as string #159

Open
zvikfir opened this issue Apr 12, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@zvikfir
Copy link

zvikfir commented Apr 12, 2023

In the RuntimeRequest constructor in Java a casting of the payload to String is performed directly.
It enforces to send the payload as JSON string instead of sending it regularly.

For example:

POST http://localhost:3000
Content-Type: application/json
X-Internal-Challenge: secret-key

{
  "variables": {
    "DISCORD_WEBHOOK_URL": ""
  },
  "payload": "{\"type\": \"Discord\",\"message\": \"some message\"}"
}

I would expect the payload to be sent as follows:

"payload" {
  "type": "Discord",
  "message": "some message"
}

I suggest storing it as an Object and letting the function developer decide how to parse it.

@joeyouss joeyouss added bug Something isn't working enhancement New feature or request and removed bug Something isn't working labels Apr 14, 2023
@joeyouss joeyouss changed the title Bug Report: Java 18.0 runtime payload parsing is only possible as string [ 馃殌 Feature]: Java 18.0 runtime payload parsing is only possible as string Apr 14, 2023
@joeyouss
Copy link

joeyouss commented Apr 14, 2023

Thank you for sharing this.
I added the feature label because this issue caters to improved developer experience. With next release, the body will be provided as is.
Relevant PR: #142

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants