Skip to content

Commit 72be5ff

Browse files
committed
fix: Put AvroEventFormatter in the right namespace
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 #219. Signed-off-by: Jon Skeet <[email protected]>
1 parent 8783914 commit 72be5ff

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

src/CloudNative.CloudEvents.Avro/AvroEventFormatter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
using System.IO;
1212
using System.Net.Mime;
1313

14-
namespace CloudNative.CloudEvents
14+
namespace CloudNative.CloudEvents.Avro
1515
{
1616
/// <summary>
1717
/// Formatter that implements the Avro Event Format.

src/CloudNative.CloudEvents.Avro/CloudNative.CloudEvents.Avro.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>
55
<Description>Avro extensions for CloudNative.CloudEvents</Description>
66
<PackageTags>cncf;cloudnative;cloudevents;events;avro</PackageTags>
7-
<LangVersion>8.0</LangVersion>
7+
<LangVersion>10.0</LangVersion>
88
<Nullable>enable</Nullable>
99
</PropertyGroup>
1010

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright 2021 Cloud Native Foundation.
2+
// Licensed under the Apache 2.0 license.
3+
// See LICENSE file in the project root for full license information.
4+
5+
using System;
6+
7+
namespace CloudNative.CloudEvents;
8+
9+
/// <summary>
10+
/// Formatter that implements the Avro Event Format.
11+
/// </summary>
12+
/// <remarks>
13+
/// This class is the wrong namespace, and is only present for backward compatibility reasons.
14+
/// Please use CloudNative.CloudEvents.Avro.AvroEventFormatter instead
15+
/// (which this class derives from for convenience).
16+
/// </remarks>
17+
[Obsolete("This class is the wrong namespace, and is only present for backward compatibility reasons. Please use CloudNative.CloudEvents.Avro.AvroEventFormatter.")]
18+
public class AvroEventFormatter : Avro.AvroEventFormatter
19+
{
20+
}

0 commit comments

Comments
 (0)