Skip to content

Commit

Permalink
System.Text.Json did not like that I defined some of the properties w…
Browse files Browse the repository at this point in the history
…ith interface return values because it can't instantiate them for deserialization, which makes sense.
  • Loading branch information
Squirrelies committed Mar 17, 2024
1 parent 3538ae5 commit d98f877
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/SRTPluginBase/Implementations/MainJson.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ namespace SRTPluginBase.Implementations
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
public class MainJson : IMainJson
{
public IEnumerable<IMainHostEntry> Hosts { get; set; }
public IEnumerable<IMainPluginEntry> Plugins { get; set; }
public IEnumerable<MainHostEntry> Hosts { get; set; }
public IEnumerable<MainPluginEntry> Plugins { get; set; }
}
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
}
2 changes: 1 addition & 1 deletion src/SRTPluginBase/Implementations/ManifestEntryJson.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace SRTPluginBase.Implementations
public class ManifestEntryJson : IManifestEntryJson
{
public IEnumerable<string> Contributors { get; set; }
public IEnumerable<IManifestReleaseJson> Releases { get; set; }
public IEnumerable<ManifestReleaseJson> Releases { get; set; }
}
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
}
5 changes: 3 additions & 2 deletions src/SRTPluginBase/Interfaces/IMainJson.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using SRTPluginBase.Implementations;

namespace SRTPluginBase.Interfaces
{
Expand All @@ -9,12 +10,12 @@ public interface IMainJson
/// <summary>
/// An array of plugin hosts.
/// </summary>
public IEnumerable<IMainHostEntry> Hosts { get; set; }
public IEnumerable<MainHostEntry> Hosts { get; set; }

/// <summary>
/// An array of plugins.
/// </summary>
public IEnumerable<IMainPluginEntry> Plugins { get; set; }
public IEnumerable<MainPluginEntry> Plugins { get; set; }

#endregion
}
Expand Down
3 changes: 2 additions & 1 deletion src/SRTPluginBase/Interfaces/IManifestEntryJson.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using SRTPluginBase.Implementations;

namespace SRTPluginBase.Interfaces
{
Expand All @@ -14,7 +15,7 @@ public interface IManifestEntryJson
/// <summary>
/// An array of releases for this entry.
/// </summary>
public IEnumerable<IManifestReleaseJson> Releases { get; set; }
public IEnumerable<ManifestReleaseJson> Releases { get; set; }

#endregion
}
Expand Down

0 comments on commit d98f877

Please sign in to comment.