arcus-azure / arcus.eventgrid

Azure Event Grid development in a breeze
https://eventgrid.arcus-azure.net/
MIT License
17 stars 6 forks source link

WIP: FIX: parse CloudEvent's without 'cloudEventsVersion' property #107

Closed stijnmoreels closed 4 years ago

stijnmoreels commented 4 years ago

Loads CloudEvents without the cloudEventVersion property, but with a specversion or dataschema (both not present in an EventGrid event).

arcus-automation commented 4 years ago

A new preview package for Arcus.EventGrid.All is available on MyGet.

You can pull it locally via the CLI:

PM> Install-Package Arcus.EventGrid.All -Version 20200110.0.0-PR-107 -Source https://www.myget.org/F/arcus/api/v3/index.json
tomkerkhove commented 4 years ago

Be careful here, we are starting to mix spec versions with each other.

While specversion is the new way of specifying the version of the schema as of CloudEvents v0.2 and above cloudEventsVersion is the way to specify the version of the event in CloudEvents v0.1.

My suggestion would be to start introducing parsers that are specific to certain spec versions. So basically we should check if:

  1. If it's a cloud event
  2. If specversion or cloudEventsVersion are specified

If the above criteria is correct, we know the spec version and should use the parser for that version. Ok if you do this as a follow-up to this PR but we should start splitting them.

Next to that, I'm wondering if there is a reason why we are adding dataschema to this? Is that just to know if it's a cloud event or not?

stijnmoreels commented 4 years ago

Be careful here, we are starting to mix spec versions with each other.

While specversion is the new way of specifying the version of the schema as of CloudEvents v0.2 and above cloudEventsVersion is the way to specify the version of the event in CloudEvents v0.1.

Hmm, the KeyVault events were only available in v0.1, and I still got a specVersion instead of cloudEventsVersion?

tomkerkhove commented 4 years ago

Key Vault events are in preview so that's no guarantee and the spec is always the master.

However, feel free to email me a Key Vault sample and I'll pass it on.