CloudEventV10Event definition

On the webhook tutorial it gives the CloudEventV10Event class definition. Specifically it defines the source property as a Uri. However the documentation (CloudEvents schema on the overview page) then goes on to say that the source is a string and an example of which is "OAWVIVCLINWGMTCQJN".


However when I attempt to create such an object for manually testing my endpoint, It says that that value is not a valid URI (which it is not).


Not sure what gives here. Should it be a string or a URI?

Comments

  • Hi David,


    It's a string as per the example ("OAWUEUDHKJZVOR32GJKS2LLXXXXXXXXXXXXXXXX"), not a URI.


    The spec on source seems to be fairly loose, with examples including - but not limited to - URNs and UUIDs:

     

    • Internet-wide unique URI with a DNS authority.
    https://github.com/cloudevents
    mailto:cncf-wg-serverless@lists.cncf.io
    • Universally-unique URN with a UUID:
    urn:uuid:6e8bc430-9c3a-11d9-9669-0800200c9a66
    • Application-specific identifiers
    /cloudevents/spec/pull/123
    /sensors/tn-1234567/alerts
    1-555-123-4567
    Cheers,

    Steve Cinquegrana | CEO and Principal Developer | Protégé Solutions

     
  • Hi Steve,


    I figured it was a string but Blackbaud's class definition should be updated in that case as it is defined in their tutorial code (bottom of step 1) as a Uri.


    Thanks


    David
  • You mean this?:

     

    <span>// Event source</span><br/> <span>[</span><span>JsonProperty</span><span>(</span>PropertyName <span>=</span> <span>"source"</span><span>)</span><span>]</span><br/> <span>public</span> <u><span>Uri</span></u> Source <span>{</span> <span>get</span><span>;</span> <span>set</span><span>;</span> <span>}</span>
    Yes, expect it should be:

     

    <span>public</span> <u><span>string</span></u> Source <span>{</span> <span>get</span><span>;</span> <span>set</span><span>;</span> <span>}</span>
    in the general case to accommodate the broad spec.

     
  • Yes, exactly that. 

Categories