Skip to content

Commit bec4864

Browse files
committed
fix tons of warnings
1 parent 54b6169 commit bec4864

60 files changed

Lines changed: 519 additions & 476 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎examples/LEGO.AsyncAPI.Readers.YamlExample/Program.cs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
using System.Net.Http;
66
using System.Text;
77
using System.Threading.Tasks;
8-
using Readers;
8+
using LEGO.AsyncAPI.Readers;
99

1010
public class Program
1111
{
1212
static async Task Main()
1313
{
1414
var httpClient = new HttpClient
1515
{
16-
BaseAddress = new Uri("https://raw.githubusercontent.com/asyncapi/spec/")
16+
BaseAddress = new Uri("https://raw.githubusercontent.com/asyncapi/spec/"),
1717
};
1818

1919
var stream = await httpClient.GetStreamAsync("master/examples/streetlights-kafka.yml");

‎src/LEGO.AsyncAPI.Readers/AsyncApiStreamReader.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public AsyncApiStreamReader()
3030
/// <returns>Instance of newly created AsyncApiDocument.</returns>
3131
public AsyncApiDocument Read(Stream input, out AsyncApiDiagnostic diagnostic)
3232
{
33-
AsyncApiDocument output = new ();
33+
AsyncApiDocument output = new();
3434

3535
try
3636
{

‎src/LEGO.AsyncAPI.Readers/AsyncApiStringReader.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public AsyncApiStringReader()
3030
/// <returns>Instance of newly created AsyncApiDocument.</returns>
3131
public AsyncApiDocument Read(string input, out AsyncApiDiagnostic diagnostic)
3232
{
33-
AsyncApiDocument output = new ();
33+
AsyncApiDocument output = new();
3434

3535
try
3636
{

‎src/LEGO.AsyncAPI/Models/Any/Boolean.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ public Boolean(bool value)
3434

3535
public static explicit operator bool(Boolean b) => b.Value;
3636

37-
public static explicit operator Boolean(bool b) => new (value: b);
37+
public static explicit operator Boolean(bool b) => new(value: b);
3838
}
3939
}

‎src/LEGO.AsyncAPI/Models/Any/Double.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ public Double(double? value)
3434

3535
public static explicit operator double?(Double d) => d.Value;
3636

37-
public static explicit operator Double(double d) => new (value: d);
37+
public static explicit operator Double(double d) => new(value: d);
3838
}
3939
}

‎src/LEGO.AsyncAPI/Models/Any/Long.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ public Long(long? value)
3434

3535
public static explicit operator long?(Long l) => l.Value;
3636

37-
public static explicit operator Long(long l) => new (value: l);
37+
public static explicit operator Long(long l) => new(value: l);
3838
}
3939
}

‎src/LEGO.AsyncAPI/Models/Any/Null.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public struct Null : IPrimitiveValue<string>
1313
/// <summary>
1414
/// Static instance of Null class.
1515
/// </summary>
16-
public static readonly Null Instance = new ();
16+
public static readonly Null Instance = new();
1717

1818
/// <summary>
1919
/// The type of <see cref="IAny"/>.

‎src/LEGO.AsyncAPI/Models/Any/String.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ public String(string value)
3333

3434
public static explicit operator string?(String s) => s.Value;
3535

36-
public static explicit operator String(string s) => new () { Value = s };
36+
public static explicit operator String(string s) => new() { Value = s };
3737
}
3838
}

‎src/LEGO.AsyncAPI/Models/Message.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public class Message : IExtensible, IReferenceable
8686
/// <summary>
8787
/// A list of traits to apply to the message object. Traits MUST be merged into the message object using the JSON Merge Patch algorithm in the same order they are defined here. The resulting object MUST be a valid Message Object.
8888
/// </summary>
89-
public List<MessageTrait> Traits { get; set; } = new ();
89+
public List<MessageTrait> Traits { get; set; } = new();
9090

9191
/// <inheritdoc/>
9292
public IDictionary<string, IAny> Extensions { get; set; } = new Dictionary<string, IAny>();

‎src/LEGO.AsyncAPI/NewtonUtils/AnyToJToken.cs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public static JToken Map(IAny o)
3434

3535
private static JToken Map(Array obj)
3636
{
37-
JArray tokenArray = new ();
37+
JArray tokenArray = new();
3838

3939
foreach (var item in obj)
4040
{
@@ -46,7 +46,7 @@ private static JToken Map(Array obj)
4646

4747
private static JToken Map(Object obj)
4848
{
49-
JObject tokenObject = new ();
49+
JObject tokenObject = new();
5050

5151
foreach (var key in obj.Keys)
5252
{

0 commit comments

Comments
 (0)