|
| 1 | +using System.Collections.Generic; |
| 2 | +using System.Text.Json.Serialization; |
1 | 3 | using BaGet.Protocol.Models;
|
2 |
| -using Newtonsoft.Json; |
3 | 4 |
|
4 | 5 | namespace BaGet.Core
|
5 | 6 | {
|
6 | 7 | /// <summary>
|
7 |
| - /// BaGet's extensions to a registration index response. These additions |
8 |
| - /// are not part of the official protocol. |
| 8 | + /// BaGet's extensions to a registration index response. |
| 9 | + /// Extends <see cref="RegistrationIndexResponse"/>. |
9 | 10 | /// </summary>
|
10 |
| - public class BaGetRegistrationIndexResponse : RegistrationIndexResponse |
| 11 | + /// <remarks> |
| 12 | + /// TODO: After this project is updated to .NET 5, make <see cref="BaGetRegistrationIndexResponse"/> |
| 13 | + /// extend <see cref="RegistrationIndexResponse"/> and remove identical properties. |
| 14 | + /// Properties that are modified should be marked with the "new" modified. |
| 15 | + /// See: https://github.com/dotnet/runtime/pull/32107 |
| 16 | + /// </remarks> |
| 17 | + public class BaGetRegistrationIndexResponse |
11 | 18 | {
|
| 19 | +#region Original properties from RegistrationIndexResponse. |
| 20 | + [JsonPropertyName("@id")] |
| 21 | + public string RegistrationIndexUrl { get; set; } |
| 22 | + |
| 23 | + [JsonPropertyName("@type")] |
| 24 | + public IReadOnlyList<string> Type { get; set; } |
| 25 | + |
| 26 | + [JsonPropertyName("count")] |
| 27 | + public int Count { get; set; } |
| 28 | +#endregion |
| 29 | + |
| 30 | + /// <summary> |
| 31 | + /// The pages that contain all of the versions of the package, ordered |
| 32 | + /// by the package's version. This was modified to use BaGet's extended |
| 33 | + /// registration index page model. |
| 34 | + /// </summary> |
| 35 | + [JsonPropertyName("items")] |
| 36 | + public IReadOnlyList<BaGetRegistrationIndexPage> Pages { get; set; } |
| 37 | + |
12 | 38 | /// <summary>
|
13 |
| - /// How many times all versions of this package have been downloaded. |
| 39 | + /// The package's total downloads across all versions. |
| 40 | + /// This is not part of the official NuGet protocol. |
14 | 41 | /// </summary>
|
15 |
| - [JsonProperty("totalDownloads")] |
| 42 | + [JsonPropertyName("totalDownloads")] |
16 | 43 | public long TotalDownloads { get; set; }
|
17 | 44 | }
|
18 | 45 | }
|
0 commit comments