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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(sdk)!: change cloud.Function event type from string to Json #6219

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

garysassano
Copy link
Collaborator

@garysassano garysassano commented Apr 12, 2024

Closes #6216

BREAKING CHANGE: The input type for cloud.Function handlers has been changed from string to Json to align with the event formats used by major cloud providers like AWS, GCP, and Azure.

This is a breaking change for any existing code that assumes the input event is a string.

To migrate:

  • Update cloud.Function handlers to expect a Json value as input instead of a string
  • Remove any JSON parsing logic since the input will already be parsed into a Json value
  • Update any tests or invocations of cloud.Function to pass in Json values instead of string

Checklist

  • Title matches Winglang's style guide
  • Description explains motivation and solution
  • Tests added (always)
  • Docs updated (only required for features)
  • Added pr/e2e-full label if this feature requires end-to-end testing

By submitting this pull request, I confirm that my contribution is made under the terms of the Wing Cloud Contribution License.

@garysassano garysassano requested a review from a team as a code owner April 12, 2024 06:30
Copy link

github-actions bot commented Apr 12, 2024

Thanks for opening this pull request! 🎉
Please consult the contributing guidelines for details on how to contribute to this project.
If you need any assistence, don't hesitate to ping the relevant owner over Discord.

Topic Owner
Wing SDK and utility APIs @chriscbr
Wing Console @ainvoner, @skyrpex, @polamoros
JSON, structs, primitives and collections @hasanaburayyan
Platforms and plugins @hasanaburayyan
Frontend resources (website, react, etc) @tsuf239
Language design @chriscbr
VSCode extension and language server @markmcculloh
Compiler architecture, inflights, lifting @yoav-steinberg
Wing Testing Framework @tsuf239
Wing CLI @markmcculloh
Build system, dev environment, releases @markmcculloh
Library Ecosystem @chriscbr
Documentation @hasanaburayyan
SDK test suite @tsuf239
Examples @hasanaburayyan
Wing Playground @eladcon

@eladb
Copy link
Contributor

eladb commented Apr 12, 2024

Please add a detailed description and a BREAKING CHANGE section to the PR description

@garysassano garysassano changed the title fix(sdk)!: attempt change input event for cloud.Function from string to Json fix(sdk)!: change cloud.Function event input type from string to Json Apr 13, 2024
@garysassano garysassano changed the title fix(sdk)!: change cloud.Function event input type from string to Json fix(sdk)!: change cloud.Function event type from string to Json Apr 13, 2024
@garysassano
Copy link
Collaborator Author

The function invocation on AWS works now.

❯ aws lambda invoke --function-name Function-c852aba6 --payload $(echo '{ "foo": 123 }' | base64)  out.json
{
    "StatusCode": 200,
    "ExecutedVersion": "$LATEST"
}

Copy link

github-actions bot commented May 4, 2024

Hi,

This PR has not seen activity in 20 days. Therefore, we are marking the PR as stale for now. It will be closed after 7 days.
If you need help with the PR, do not hesitate to reach out in the winglang community discord at winglang.discord.com.
Feel free to re-open this PR when it is still relevant and ready to be worked on again.
Thanks!

@github-actions github-actions bot added the Stale label May 4, 2024
@garysassano garysassano removed the Stale label May 4, 2024
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.

AWS Lambda input event is JSON and not string
3 participants