Skip to content

Commit 1d42d68

Browse files
committed
Document public OpenAPI members, remove unused IJsonApiClient
1 parent fe38678 commit 1d42d68

File tree

5 files changed

+43
-42
lines changed

5 files changed

+43
-42
lines changed

src/JsonApiDotNetCore.OpenApi.Client.NSwag/ApiException.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@
55

66
namespace JsonApiDotNetCore.OpenApi.Client.NSwag;
77

8+
/// <summary>
9+
/// Replacement for the auto-generated
10+
/// <c>
11+
/// ApiException
12+
/// </c>
13+
/// class from NSwag.
14+
/// </summary>
815
[UsedImplicitly(ImplicitUseTargetFlags.Members)]
916
public class ApiException(string message, int statusCode, string? response, IReadOnlyDictionary<string, IEnumerable<string>> headers, Exception? innerException)
1017
: Exception($"HTTP {statusCode}: {message}", innerException)
@@ -14,6 +21,13 @@ public class ApiException(string message, int statusCode, string? response, IRea
1421
public IReadOnlyDictionary<string, IEnumerable<string>> Headers { get; } = headers;
1522
}
1623

24+
/// <summary>
25+
/// Replacement for the auto-generated
26+
/// <c>
27+
/// ApiException&lt;TResult&gt;
28+
/// </c>
29+
/// class from NSwag.
30+
/// </summary>
1731
[UsedImplicitly(ImplicitUseTargetFlags.Members)]
1832
public sealed class ApiException<TResult>(
1933
string message, int statusCode, string? response, IReadOnlyDictionary<string, IEnumerable<string>> headers, TResult result, Exception? innerException)

src/JsonApiDotNetCore.OpenApi.Client.NSwag/ApiResponse.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33

44
namespace JsonApiDotNetCore.OpenApi.Client.NSwag;
55

6+
/// <summary>
7+
/// Replacement for the auto-generated
8+
/// <c>
9+
/// SwaggerResponse
10+
/// </c>
11+
/// class from NSwag.
12+
/// </summary>
613
[PublicAPI]
714
public class ApiResponse(int statusCode, IReadOnlyDictionary<string, IEnumerable<string>> headers)
815
{
@@ -71,6 +78,13 @@ public static async Task<ApiResponse> TranslateAsync(Func<Task<ApiResponse>> ope
7178
}
7279
}
7380

81+
/// <summary>
82+
/// Replacement for the auto-generated
83+
/// <c>
84+
/// SwaggerResponse&lt;TResult&gt;
85+
/// </c>
86+
/// class from NSwag.
87+
/// </summary>
7488
[PublicAPI]
7589
public class ApiResponse<TResult>(int statusCode, IReadOnlyDictionary<string, IEnumerable<string>> headers, TResult result)
7690
: ApiResponse(statusCode, headers)

src/JsonApiDotNetCore.OpenApi.Client.NSwag/BlockedJsonInheritanceConverter.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
namespace JsonApiDotNetCore.OpenApi.Client.NSwag;
55

66
// Referenced from liquid template, to ensure the built-in JsonInheritanceConverter from NSwag is never used.
7+
/// <summary>
8+
/// Exists to block usage of the default
9+
/// <c>
10+
/// JsonInheritanceConverter
11+
/// </c>
12+
/// from NSwag, which is incompatible with JSON:API.
13+
/// </summary>
714
[PublicAPI]
815
public abstract class BlockedJsonInheritanceConverter : JsonConverter
916
{
@@ -31,11 +38,17 @@ public override bool CanConvert(Type objectType)
3138
return true;
3239
}
3340

41+
/// <summary>
42+
/// Always throws an <see cref="InvalidOperationException" />.
43+
/// </summary>
3444
public override void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer)
3545
{
3646
throw new InvalidOperationException("JsonInheritanceConverter is incompatible with JSON:API and must not be used.");
3747
}
3848

49+
/// <summary>
50+
/// Always throws an <see cref="InvalidOperationException" />.
51+
/// </summary>
3952
public override object ReadJson(JsonReader reader, Type objectType, object? existingValue, JsonSerializer serializer)
4053
{
4154
throw new InvalidOperationException("JsonInheritanceConverter is incompatible with JSON:API and must not be used.");

src/JsonApiDotNetCore.OpenApi.Client.NSwag/IJsonApiClient.cs

Lines changed: 0 additions & 41 deletions
This file was deleted.

src/JsonApiDotNetCore.OpenApi.Client.NSwag/NotifyPropertySet.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
namespace JsonApiDotNetCore.OpenApi.Client.NSwag;
1212

1313
/// <summary>
14-
/// Implementation of <see cref="INotifyPropertyChanged" /> that doesn't detect changes.
14+
/// Implementation of <see cref="INotifyPropertyChanged" /> that unconditionally raises the <see cref="PropertyChanged" /> event when a property is
15+
/// assigned. Exists to support JSON:API partial POST/PATCH.
1516
/// </summary>
1617
[PublicAPI]
1718
public abstract class NotifyPropertySet : INotifyPropertyChanged

0 commit comments

Comments
 (0)