forked from loic-sharma/BaGet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move to System.Text.Json (loic-sharma#559)
Replaces Newtonsoft.Json with System.Text.Json. This will simplifies the route-to-code migration (see loic-sharma#558).
- Loading branch information
1 parent
58e00e8
commit 9c16b00
Showing
69 changed files
with
1,012 additions
and
660 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using System.Collections.Generic; | ||
using System.Text.Json.Serialization; | ||
using BaGet.Protocol.Models; | ||
|
||
namespace BaGet.Core | ||
{ | ||
/// <summary> | ||
/// BaGet's extensions to a registration index page. | ||
/// Extends <see cref="RegistrationIndexPage"/>. | ||
/// </summary> | ||
/// <remarks> | ||
/// TODO: After this project is updated to .NET 5, make <see cref="BaGetRegistrationIndexPage"/> | ||
/// extend <see cref="RegistrationIndexPage"/> and remove identical properties. | ||
/// Properties that are modified should be marked with the "new" modified. | ||
/// See: https://github.com/dotnet/runtime/pull/32107 | ||
/// </remarks> | ||
public class BaGetRegistrationIndexPage | ||
{ | ||
#region Original properties from RegistrationIndexPage. | ||
[JsonPropertyName("@id")] | ||
public string RegistrationPageUrl { get; set; } | ||
|
||
[JsonPropertyName("count")] | ||
public int Count { get; set; } | ||
|
||
[JsonPropertyName("lower")] | ||
public string Lower { get; set; } | ||
|
||
[JsonPropertyName("upper")] | ||
public string Upper { get; set; } | ||
#endregion | ||
|
||
/// <summary> | ||
/// This was modified to use BaGet's extended registration index page item model. | ||
/// </summary> | ||
[JsonPropertyName("items")] | ||
public IReadOnlyList<BaGetRegistrationIndexPageItem> ItemsOrNull { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System.Text.Json.Serialization; | ||
using BaGet.Protocol.Models; | ||
|
||
namespace BaGet.Core | ||
{ | ||
/// <summary> | ||
/// BaGet's extensions to a registration index page. | ||
/// Extends <see cref="RegistrationIndexPageItem"/>. | ||
/// </summary> | ||
/// <remarks> | ||
/// TODO: After this project is updated to .NET 5, make <see cref="BaGetRegistrationIndexPageItem"/> | ||
/// extend <see cref="RegistrationIndexPageItem"/> and remove identical properties. | ||
/// Properties that are modified should be marked with the "new" modified. | ||
/// See: https://github.com/dotnet/runtime/pull/32107 | ||
/// </remarks> | ||
public class BaGetRegistrationIndexPageItem | ||
{ | ||
#region Original properties from RegistrationIndexPageItem. | ||
[JsonPropertyName("@id")] | ||
public string RegistrationLeafUrl { get; set; } | ||
|
||
[JsonPropertyName("packageContent")] | ||
public string PackageContentUrl { get; set; } | ||
#endregion | ||
|
||
/// <summary> | ||
/// The catalog entry containing the package metadata. | ||
/// This was modified to use BaGet's extended package metadata model. | ||
/// </summary> | ||
[JsonPropertyName("catalogEntry")] | ||
public BaGetPackageMetadata PackageMetadata { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,45 @@ | ||
using System.Collections.Generic; | ||
using System.Text.Json.Serialization; | ||
using BaGet.Protocol.Models; | ||
using Newtonsoft.Json; | ||
|
||
namespace BaGet.Core | ||
{ | ||
/// <summary> | ||
/// BaGet's extensions to a registration index response. These additions | ||
/// are not part of the official protocol. | ||
/// BaGet's extensions to a registration index response. | ||
/// Extends <see cref="RegistrationIndexResponse"/>. | ||
/// </summary> | ||
public class BaGetRegistrationIndexResponse : RegistrationIndexResponse | ||
/// <remarks> | ||
/// TODO: After this project is updated to .NET 5, make <see cref="BaGetRegistrationIndexResponse"/> | ||
/// extend <see cref="RegistrationIndexResponse"/> and remove identical properties. | ||
/// Properties that are modified should be marked with the "new" modified. | ||
/// See: https://github.com/dotnet/runtime/pull/32107 | ||
/// </remarks> | ||
public class BaGetRegistrationIndexResponse | ||
{ | ||
#region Original properties from RegistrationIndexResponse. | ||
[JsonPropertyName("@id")] | ||
public string RegistrationIndexUrl { get; set; } | ||
|
||
[JsonPropertyName("@type")] | ||
public IReadOnlyList<string> Type { get; set; } | ||
|
||
[JsonPropertyName("count")] | ||
public int Count { get; set; } | ||
#endregion | ||
|
||
/// <summary> | ||
/// The pages that contain all of the versions of the package, ordered | ||
/// by the package's version. This was modified to use BaGet's extended | ||
/// registration index page model. | ||
/// </summary> | ||
[JsonPropertyName("items")] | ||
public IReadOnlyList<BaGetRegistrationIndexPage> Pages { get; set; } | ||
|
||
/// <summary> | ||
/// How many times all versions of this package have been downloaded. | ||
/// The package's total downloads across all versions. | ||
/// This is not part of the official NuGet protocol. | ||
/// </summary> | ||
[JsonProperty("totalDownloads")] | ||
[JsonPropertyName("totalDownloads")] | ||
public long TotalDownloads { get; set; } | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 0 additions & 17 deletions
17
src/BaGet.Hosting/Extensions/IEndpointRouteBuilderExtensions.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.