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

Remove ambiguity for UNSPECIFIED UPayloadFormat #247

Merged
merged 2 commits into from
Nov 11, 2024

Conversation

stevenhartley
Copy link
Contributor

Previously (version 1.3.6 and earlier of the specification) we did not have an enum for the payload format (it was a string) and sending the string was costly to the cloud even though we always knew it was WRAPPED_IN_ANY. To avoid sending the payload format we omitted the attribute and then "assumed" that if it was not present it would be WRAPPED_IN_ANY. Now that we have an enum defined, it is better to remove the ambiguity of this attribute and make it explicit, this means that if someone sets it to UNSPECIFIED it really means unspecified (we don't know or are not setting it to anything). Additionally, for SOME/IP there is no way to pass this attribute (UPayloadFormat) so we have to set UPayloadFormat as UNSPECIFIED and then leave it up to the client to know the format from the source.

#237

Previously (version 1.3.6 and earlier of the specification) we did not have an enum for the payload format (it was a string) and sending the string was costly to the cloud even though we always knew it was WRAPPED_IN_ANY. To avoid sending the payload format we omitted the attribute and then  "assumed" that if it was not present it would be WRAPPED_IN_ANY.  Now that we have an enum defined, it is better to remove the ambiguity of this attribute and make it explicit, this means that if someone sets it to UNSPECIFIED it really means unspecified (we don't know or are not setting it to anything). Additionally, for SOME/IP there is no way to pass this attribute (UPayloadFormat) so we have to set UPayloadFormat as UNSPECIFIED and then leave it up to the client to know the format from the source.

eclipse-uprotocol#237
Copy link
Contributor

@sophokles73 sophokles73 left a comment

Choose a reason for hiding this comment

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

Making this change will also require a change to the corresponding specitem revision in the uattributes/umessage specification where we define that the payload format should be assumed to be WRAPPED_IN_ANY if not specified. This will make sure that OFT discovers the discrepancy between spec and implementation...

@stevenhartley
Copy link
Contributor Author

Making this change will also require a change to the corresponding specitem revision in the uattributes/umessage specification where we define that the payload format should be assumed to be WRAPPED_IN_ANY if not specified. This will make sure that OFT discovers the discrepancy between spec and implementation...

There is no OFT requirement for this in upayload.adoc or in uattributes.adoc, it will need to be added on a subsequent PR

@sophokles73 sophokles73 added the breaking change This pull request introduces a change to public API which is not backwards compatible label Nov 11, 2024
Copy link
Contributor

@sophokles73 sophokles73 left a comment

Choose a reason for hiding this comment

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

I see, I will create a PR for adding some wording and OFT spec item then ...

LGTM

@sophokles73 sophokles73 merged commit e953cb2 into eclipse-uprotocol:main Nov 11, 2024
2 checks passed
sophokles73 added a commit to SoftwareDefinedVehicle/uprotocol-spec-fork that referenced this pull request Nov 11, 2024
sophokles73 added a commit to SoftwareDefinedVehicle/uprotocol-spec-fork that referenced this pull request Nov 11, 2024
stevenhartley pushed a commit that referenced this pull request Nov 25, 2024
* Support UNSPECIFIED payload format in CloudEvents mapping

This is a follow up of
#247

* Change the type name of uProtocol messages

The names defined for the different uProtocol message types have been
changed to allow distinguishing between existing CloudEvents being
exchanged by legacy systems using a predecessor of Eclipse uProtocol
and CloudEvents conforming to the mapping rules defined in the
uProtocol specification.
@stevenhartley
Copy link
Contributor Author

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change This pull request introduces a change to public API which is not backwards compatible
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants