Skip to content

Commit

Permalink
fix: Put AvroEventFormatter in the right namespace
Browse files Browse the repository at this point in the history
We still need it in CloudNative.CloudEvents for backward
compatibility, but we can do that via derivation - which is
pleasantly simple given that the only constructor is parameterless.

Users should update to use the CloudNative.CloudEvents.Avro
namespace at their earliest convenience.

Fixes cloudevents#219.

Signed-off-by: Jon Skeet <jonskeet@google.com>
  • Loading branch information
jskeet committed Jul 1, 2022
1 parent 3ce4aa0 commit d641457
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/CloudNative.CloudEvents.Avro/AvroEventFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
using System.IO;
using System.Net.Mime;

namespace CloudNative.CloudEvents
namespace CloudNative.CloudEvents.Avro
{
/// <summary>
/// Formatter that implements the Avro Event Format.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>
<Description>Avro extensions for CloudNative.CloudEvents</Description>
<PackageTags>cncf;cloudnative;cloudevents;events;avro</PackageTags>
<LangVersion>8.0</LangVersion>
<LangVersion>10.0</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>

Expand Down
20 changes: 20 additions & 0 deletions src/CloudNative.CloudEvents.Avro/ObsoleteFormatter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright 2021 Cloud Native Foundation.
// Licensed under the Apache 2.0 license.
// See LICENSE file in the project root for full license information.

using System;

namespace CloudNative.CloudEvents;

/// <summary>
/// Formatter that implements the Avro Event Format.
/// </summary>
/// <remarks>
/// This class is the wrong namespace, and is only present for backward compatibility reasons.
/// Please use CloudNative.CloudEvents.Avro.AvroEventFormatter instead
/// (which this class derives from for convenience).
/// </remarks>
[Obsolete("This class is the wrong namespace, and is only present for backward compatibility reasons. Please use CloudNative.CloudEvents.Avro.AvroEventFormatter.")]
public class AvroEventFormatter : Avro.AvroEventFormatter
{
}

0 comments on commit d641457

Please sign in to comment.