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

fix: Put AvroEventFormatter in the right namespace #220

Merged
merged 1 commit into from
Jul 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.")]
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this may be a breaking change depending on compiler options being used. Would it be sufficient to use EditorBrowsableState.Never instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've always taken the view that making something obsolete with a warning shouldn't be regarded as a breaking change - if users have explicitly opted in to making warnings errors, they're basically opting into having broken builds more often. There are any number of things which may introduce warnings but aren't normally considered as breaking changes. (Annoyingly, this isn't mentioned in the canonical breaking change documentation as far as I can see.)

Copy link
Contributor

Choose a reason for hiding this comment

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

Fair enough!

public class AvroEventFormatter : Avro.AvroEventFormatter
{
}