Skip to content

Loosen requirements on the data payload of CloudEvents. #30

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

Merged
merged 1 commit into from
Sep 15, 2020

Conversation

eamonnmcmanus
Copy link
Member

When a legacy event is converted to a CloudEvent, we know that we want a certain
JSON payload, but we shouldn't require that payload to be formatted exactly the
same as the JSON payload in our golden files. Instead, we unmarshal both the
actual and expected values into maps, and we check that those maps are equal.

When a legacy event is converted to a CloudEvent, we know that we want a certain
JSON payload, but we shouldn't require that payload to be formatted exactly the
same as the JSON payload in our golden files. Instead, we unmarshal both the
actual and expected values into maps, and we check that those maps are equal.
eamonnmcmanus added a commit to GoogleCloudPlatform/functions-framework-java that referenced this pull request Sep 10, 2020
This allows received Legacy Events to be handled by function code that expects a
CloudEvent input. The translation logic and tests are based closely on the
corresponding code in https://github.com/GoogleCloudPlatform/functions-framework-dotnet.

The new code also passes the relevant conformance tests in
https://github.com/GoogleCloudPlatform/functions-framework-conformance, once
GoogleCloudPlatform/functions-framework-conformance#30
is applied. For now I'm running those tests manually. I plan at least to commit
the script and test functions that allow me to do so.
eamonnmcmanus added a commit to GoogleCloudPlatform/functions-framework-java that referenced this pull request Sep 11, 2020
* Add explanatory comments to the new code in BackgroundFunctionExecutor.

* Add logic to convert from Legacy Events to CloudEvents.

This allows received Legacy Events to be handled by function code that expects a
CloudEvent input. The translation logic and tests are based closely on the
corresponding code in https://github.com/GoogleCloudPlatform/functions-framework-dotnet.

The new code also passes the relevant conformance tests in
https://github.com/GoogleCloudPlatform/functions-framework-conformance, once
GoogleCloudPlatform/functions-framework-conformance#30
is applied. For now I'm running those tests manually. I plan at least to commit
the script and test functions that allow me to do so.
@roffjulie roffjulie merged commit 62632a3 into master Sep 15, 2020
@roffjulie roffjulie deleted the loosejson branch October 7, 2020 00:22
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.

2 participants