Skip to content

Commit bf841f9

Browse files
committed
- Replaced ResourceContext with ResourceType and calls to ResourceType.ClrType
- Applied NRT - Renamed methods that used TryXXX pattern - For files in JsonApiObjects folder: instead of adding null! to every property assignment, I decided to disable the warning. This seems reasonable because these types have been introduced to only pass static type information to the ApiExplorer. They are guaranteed to never be instantiated.
1 parent fb8913f commit bf841f9

File tree

67 files changed

+290
-213
lines changed

Some content is hidden

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

67 files changed

+290
-213
lines changed

src/JsonApiDotNetCore.OpenApi.Client/ArgumentGuard.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using JetBrains.Annotations;
3+
using SysNotNull = System.Diagnostics.CodeAnalysis.NotNullAttribute;
34

45
#pragma warning disable AV1008 // Class should not be static
56

@@ -8,8 +9,7 @@ namespace JsonApiDotNetCore.OpenApi.Client
89
internal static class ArgumentGuard
910
{
1011
[AssertionMethod]
11-
[ContractAnnotation("value: null => halt")]
12-
public static void NotNull<T>([CanBeNull] [NoEnumeration] T value, [NotNull] [InvokerParameterName] string name)
12+
public static void NotNull<T>([NoEnumeration] [SysNotNull] T? value, [InvokerParameterName] string name)
1313
where T : class
1414
{
1515
if (value is null)

src/JsonApiDotNetCore.OpenApi.Client/IJsonApiClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public interface IJsonApiClient
3232
/// <c>using</c> statement, so the registrations are cleaned up after executing the request.
3333
/// </returns>
3434
IDisposable RegisterAttributesForRequestDocument<TRequestDocument, TAttributesObject>(TRequestDocument requestDocument,
35-
params Expression<Func<TAttributesObject, object>>[] alwaysIncludedAttributeSelectors)
35+
params Expression<Func<TAttributesObject, object?>>[] alwaysIncludedAttributeSelectors)
3636
where TRequestDocument : class;
3737
}
3838
}

src/JsonApiDotNetCore.OpenApi.Client/JsonApiClient.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ protected void SetSerializerSettingsForJsonApi(JsonSerializerSettings settings)
2727

2828
/// <inheritdoc />
2929
public IDisposable RegisterAttributesForRequestDocument<TRequestDocument, TAttributesObject>(TRequestDocument requestDocument,
30-
params Expression<Func<TAttributesObject, object>>[] alwaysIncludedAttributeSelectors)
30+
params Expression<Func<TAttributesObject, object?>>[] alwaysIncludedAttributeSelectors)
3131
where TRequestDocument : class
3232
{
3333
ArgumentGuard.NotNull(requestDocument, nameof(requestDocument));
3434

3535
var attributeNames = new HashSet<string>();
3636

37-
foreach (Expression<Func<TAttributesObject, object>> selector in alwaysIncludedAttributeSelectors)
37+
foreach (Expression<Func<TAttributesObject, object?>> selector in alwaysIncludedAttributeSelectors)
3838
{
3939
if (RemoveConvert(selector.Body) is MemberExpression selectorBody)
4040
{

src/JsonApiDotNetCore.OpenApi/ActionDescriptorExtensions.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,22 @@ public static MethodInfo GetActionMethod(this ActionDescriptor descriptor)
1616
return ((ControllerActionDescriptor)descriptor).MethodInfo;
1717
}
1818

19-
public static TFilterMetaData GetFilterMetadata<TFilterMetaData>(this ActionDescriptor descriptor)
19+
public static TFilterMetaData? GetFilterMetadata<TFilterMetaData>(this ActionDescriptor descriptor)
2020
where TFilterMetaData : IFilterMetadata
2121
{
2222
ArgumentGuard.NotNull(descriptor, nameof(descriptor));
2323

24-
IFilterMetadata filterMetadata = descriptor.FilterDescriptors.Select(filterDescriptor => filterDescriptor.Filter)
24+
IFilterMetadata? filterMetadata = descriptor.FilterDescriptors.Select(filterDescriptor => filterDescriptor.Filter)
2525
.FirstOrDefault(filter => filter is TFilterMetaData);
2626

27-
return (TFilterMetaData)filterMetadata;
27+
return (TFilterMetaData?)filterMetadata;
2828
}
2929

30-
public static ControllerParameterDescriptor GetBodyParameterDescriptor(this ActionDescriptor descriptor)
30+
public static ControllerParameterDescriptor? GetBodyParameterDescriptor(this ActionDescriptor descriptor)
3131
{
3232
ArgumentGuard.NotNull(descriptor, nameof(descriptor));
3333

34-
return (ControllerParameterDescriptor)descriptor.Parameters.FirstOrDefault(parameterDescriptor =>
34+
return (ControllerParameterDescriptor?)descriptor.Parameters.FirstOrDefault(parameterDescriptor =>
3535
// ReSharper disable once ConstantConditionalAccessQualifier Motivation: see https://github.com/dotnet/aspnetcore/issues/32538
3636
parameterDescriptor.BindingInfo?.BindingSource == BindingSource.Body);
3737
}

src/JsonApiDotNetCore.OpenApi/JsonApiActionDescriptorCollectionProvider.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ private static bool IsVisibleJsonApiEndpoint(ActionDescriptor descriptor)
6767
return descriptor is ControllerActionDescriptor controllerAction && controllerAction.Properties.ContainsKey(typeof(ApiDescriptionActionData));
6868
}
6969

70-
private static IList<ActionDescriptor> AddJsonApiMetadataToAction(ActionDescriptor endpoint, IJsonApiEndpointMetadata jsonApiEndpointMetadata)
70+
private static IList<ActionDescriptor> AddJsonApiMetadataToAction(ActionDescriptor endpoint, IJsonApiEndpointMetadata? jsonApiEndpointMetadata)
7171
{
7272
switch (jsonApiEndpointMetadata)
7373
{
@@ -102,16 +102,16 @@ private static void UpdateProducesResponseTypeAttribute(ActionDescriptor endpoin
102102
{
103103
if (ProducesJsonApiResponseBody(endpoint))
104104
{
105-
var producesResponse = endpoint.GetFilterMetadata<ProducesResponseTypeAttribute>();
105+
var producesResponse = endpoint.GetFilterMetadata<ProducesResponseTypeAttribute>()!;
106106
producesResponse.Type = responseTypeToSet;
107107
}
108108
}
109109

110110
private static bool ProducesJsonApiResponseBody(ActionDescriptor endpoint)
111111
{
112-
var produces = endpoint.GetFilterMetadata<ProducesAttribute>();
112+
var produces = endpoint.GetFilterMetadata<ProducesAttribute>()!;
113113

114-
return produces != null && produces.ContentTypes.Any(contentType => contentType == HeaderConstants.MediaType);
114+
return produces.ContentTypes.Any(contentType => contentType == HeaderConstants.MediaType);
115115
}
116116

117117
private static IList<ActionDescriptor> Expand(ActionDescriptor genericEndpoint, ExpansibleEndpointMetadata metadata,
@@ -123,7 +123,7 @@ private static IList<ActionDescriptor> Expand(ActionDescriptor genericEndpoint,
123123
{
124124
ActionDescriptor expandedEndpoint = Clone(genericEndpoint);
125125
RemovePathParameter(expandedEndpoint.Parameters, JsonApiPathParameter.RelationshipName);
126-
ExpandTemplate(expandedEndpoint.AttributeRouteInfo, relationshipName);
126+
ExpandTemplate(expandedEndpoint.AttributeRouteInfo!, relationshipName);
127127

128128
expansionCallback(expandedEndpoint, relationshipType, relationshipName);
129129

@@ -133,9 +133,9 @@ private static IList<ActionDescriptor> Expand(ActionDescriptor genericEndpoint,
133133
return expansion;
134134
}
135135

136-
private static void UpdateBodyParameterDescriptor(ActionDescriptor endpoint, Type bodyType, string parameterName = null)
136+
private static void UpdateBodyParameterDescriptor(ActionDescriptor endpoint, Type bodyType, string? parameterName = null)
137137
{
138-
ControllerParameterDescriptor requestBodyDescriptor = endpoint.GetBodyParameterDescriptor();
138+
ControllerParameterDescriptor requestBodyDescriptor = endpoint.GetBodyParameterDescriptor()!;
139139
requestBodyDescriptor.ParameterType = bodyType;
140140
ParameterInfo replacementParameterInfo = requestBodyDescriptor.ParameterInfo.WithParameterType(bodyType);
141141

@@ -151,7 +151,7 @@ private static ActionDescriptor Clone(ActionDescriptor descriptor)
151151
{
152152
var clonedDescriptor = (ActionDescriptor)descriptor.MemberwiseClone();
153153

154-
clonedDescriptor.AttributeRouteInfo = (AttributeRouteInfo)descriptor.AttributeRouteInfo.MemberwiseClone();
154+
clonedDescriptor.AttributeRouteInfo = (AttributeRouteInfo)descriptor.AttributeRouteInfo!.MemberwiseClone();
155155

156156
clonedDescriptor.FilterDescriptors = new List<FilterDescriptor>();
157157

src/JsonApiDotNetCore.OpenApi/JsonApiMetadata/EndpointResolver.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ internal sealed class EndpointResolver
1818
return null;
1919
}
2020

21-
HttpMethodAttribute method = controllerAction.GetCustomAttributes(true).OfType<HttpMethodAttribute>().FirstOrDefault();
21+
HttpMethodAttribute? method = controllerAction.GetCustomAttributes(true).OfType<HttpMethodAttribute>().FirstOrDefault();
2222

2323
return ResolveJsonApiEndpoint(method);
2424
}
@@ -33,7 +33,7 @@ private static bool IsOperationsController(MethodInfo controllerAction)
3333
return typeof(BaseJsonApiOperationsController).IsAssignableFrom(controllerAction.ReflectedType);
3434
}
3535

36-
private static JsonApiEndpoint? ResolveJsonApiEndpoint(HttpMethodAttribute httpMethod)
36+
private static JsonApiEndpoint? ResolveJsonApiEndpoint(HttpMethodAttribute? httpMethod)
3737
{
3838
return httpMethod switch
3939
{

src/JsonApiDotNetCore.OpenApi/JsonApiMetadata/JsonApiEndpointMetadataContainer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ namespace JsonApiDotNetCore.OpenApi.JsonApiMetadata
55
/// </summary>
66
internal sealed class JsonApiEndpointMetadataContainer
77
{
8-
public IJsonApiRequestMetadata RequestMetadata { get; init; }
8+
public IJsonApiRequestMetadata? RequestMetadata { get; init; }
99

10-
public IJsonApiResponseMetadata ResponseMetadata { get; init; }
10+
public IJsonApiResponseMetadata? ResponseMetadata { get; init; }
1111
}
1212
}

src/JsonApiDotNetCore.OpenApi/JsonApiMetadata/JsonApiEndpointMetadataProvider.cs

Lines changed: 24 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,16 @@ public JsonApiEndpointMetadataContainer Get(MethodInfo controllerAction)
4040
throw new NotSupportedException($"Unable to provide metadata for non-JsonApiDotNetCore endpoint '{controllerAction.ReflectedType!.FullName}'.");
4141
}
4242

43-
Type primaryResourceType = _controllerResourceMapping.GetResourceTypeForController(controllerAction.ReflectedType);
43+
ResourceType primaryResourceType = _controllerResourceMapping.GetResourceTypeForController(controllerAction.ReflectedType)!;
4444

4545
return new JsonApiEndpointMetadataContainer
4646
{
47-
RequestMetadata = GetRequestMetadata(endpoint.Value, primaryResourceType),
48-
ResponseMetadata = GetResponseMetadata(endpoint.Value, primaryResourceType)
47+
RequestMetadata = GetRequestMetadata(endpoint.Value, primaryResourceType.ClrType),
48+
ResponseMetadata = GetResponseMetadata(endpoint.Value, primaryResourceType.ClrType)
4949
};
5050
}
5151

52-
private IJsonApiRequestMetadata GetRequestMetadata(JsonApiEndpoint endpoint, Type primaryResourceType)
52+
private IJsonApiRequestMetadata? GetRequestMetadata(JsonApiEndpoint endpoint, Type primaryResourceType)
5353
{
5454
switch (endpoint)
5555
{
@@ -76,23 +76,21 @@ private IJsonApiRequestMetadata GetRequestMetadata(JsonApiEndpoint endpoint, Typ
7676

7777
private static PrimaryRequestMetadata GetPostRequestMetadata(Type primaryResourceType)
7878
{
79-
return new()
80-
{
81-
Type = typeof(ResourcePostRequestDocument<>).MakeGenericType(primaryResourceType)
82-
};
79+
Type documentType = typeof(ResourcePostRequestDocument<>).MakeGenericType(primaryResourceType);
80+
81+
return new PrimaryRequestMetadata(documentType);
8382
}
8483

8584
private static PrimaryRequestMetadata GetPatchRequestMetadata(Type primaryResourceType)
8685
{
87-
return new()
88-
{
89-
Type = typeof(ResourcePatchRequestDocument<>).MakeGenericType(primaryResourceType)
90-
};
86+
Type documentType = typeof(ResourcePatchRequestDocument<>).MakeGenericType(primaryResourceType);
87+
88+
return new PrimaryRequestMetadata(documentType);
9189
}
9290

9391
private RelationshipRequestMetadata GetRelationshipRequestMetadata(Type primaryResourceType, bool ignoreHasOneRelationships)
9492
{
95-
IEnumerable<RelationshipAttribute> relationships = _resourceGraph.GetResourceContext(primaryResourceType).Relationships;
93+
IEnumerable<RelationshipAttribute> relationships = _resourceGraph.GetResourceType(primaryResourceType).Relationships;
9694

9795
if (ignoreHasOneRelationships)
9896
{
@@ -101,16 +99,13 @@ private RelationshipRequestMetadata GetRelationshipRequestMetadata(Type primaryR
10199

102100
IDictionary<string, Type> resourceTypesByRelationshipName = relationships.ToDictionary(relationship => relationship.PublicName,
103101
relationship => relationship is HasManyAttribute
104-
? typeof(ToManyRelationshipRequestData<>).MakeGenericType(relationship.RightType)
105-
: typeof(ToOneRelationshipRequestData<>).MakeGenericType(relationship.RightType));
102+
? typeof(ToManyRelationshipRequestData<>).MakeGenericType(relationship.RightType.ClrType)
103+
: typeof(ToOneRelationshipRequestData<>).MakeGenericType(relationship.RightType.ClrType));
106104

107-
return new RelationshipRequestMetadata
108-
{
109-
RequestBodyTypeByRelationshipName = resourceTypesByRelationshipName
110-
};
105+
return new RelationshipRequestMetadata(resourceTypesByRelationshipName);
111106
}
112107

113-
private IJsonApiResponseMetadata GetResponseMetadata(JsonApiEndpoint endpoint, Type primaryResourceType)
108+
private IJsonApiResponseMetadata? GetResponseMetadata(JsonApiEndpoint endpoint, Type primaryResourceType)
114109
{
115110
switch (endpoint)
116111
{
@@ -138,12 +133,10 @@ private IJsonApiResponseMetadata GetResponseMetadata(JsonApiEndpoint endpoint, T
138133

139134
private static PrimaryResponseMetadata GetPrimaryResponseMetadata(Type primaryResourceType, bool endpointReturnsCollection)
140135
{
141-
Type documentType = endpointReturnsCollection ? typeof(ResourceCollectionResponseDocument<>) : typeof(PrimaryResourceResponseDocument<>);
136+
Type documentOpenType = endpointReturnsCollection ? typeof(ResourceCollectionResponseDocument<>) : typeof(PrimaryResourceResponseDocument<>);
137+
Type documentType = documentOpenType.MakeGenericType(primaryResourceType);
142138

143-
return new PrimaryResponseMetadata
144-
{
145-
Type = documentType.MakeGenericType(primaryResourceType)
146-
};
139+
return new PrimaryResponseMetadata(documentType);
147140
}
148141

149142
private SecondaryResponseMetadata GetSecondaryResponseMetadata(Type primaryResourceType)
@@ -154,19 +147,16 @@ private SecondaryResponseMetadata GetSecondaryResponseMetadata(Type primaryResou
154147
? typeof(ResourceCollectionResponseDocument<>)
155148
: typeof(SecondaryResourceResponseDocument<>);
156149

157-
return documentType.MakeGenericType(relationship.RightType);
150+
return documentType.MakeGenericType(relationship.RightType.ClrType);
158151
});
159152

160-
return new SecondaryResponseMetadata
161-
{
162-
ResponseTypesByRelationshipName = responseTypesByRelationshipName
163-
};
153+
return new SecondaryResponseMetadata(responseTypesByRelationshipName);
164154
}
165155

166156
private IDictionary<string, Type> GetMetadataByRelationshipName(Type primaryResourceType,
167157
Func<RelationshipAttribute, Type> extractRelationshipMetadataCallback)
168158
{
169-
IReadOnlyCollection<RelationshipAttribute> relationships = _resourceGraph.GetResourceContext(primaryResourceType).Relationships;
159+
IReadOnlyCollection<RelationshipAttribute> relationships = _resourceGraph.GetResourceType(primaryResourceType).Relationships;
170160

171161
return relationships.ToDictionary(relationship => relationship.PublicName, extractRelationshipMetadataCallback);
172162
}
@@ -175,13 +165,10 @@ private RelationshipResponseMetadata GetRelationshipResponseMetadata(Type primar
175165
{
176166
IDictionary<string, Type> responseTypesByRelationshipName = GetMetadataByRelationshipName(primaryResourceType,
177167
relationship => relationship is HasManyAttribute
178-
? typeof(ResourceIdentifierCollectionResponseDocument<>).MakeGenericType(relationship.RightType)
179-
: typeof(ResourceIdentifierResponseDocument<>).MakeGenericType(relationship.RightType));
168+
? typeof(ResourceIdentifierCollectionResponseDocument<>).MakeGenericType(relationship.RightType.ClrType)
169+
: typeof(ResourceIdentifierResponseDocument<>).MakeGenericType(relationship.RightType.ClrType));
180170

181-
return new RelationshipResponseMetadata
182-
{
183-
ResponseTypesByRelationshipName = responseTypesByRelationshipName
184-
};
171+
return new RelationshipResponseMetadata(responseTypesByRelationshipName);
185172
}
186173
}
187174
}

src/JsonApiDotNetCore.OpenApi/JsonApiMetadata/PrimaryRequestMetadata.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ namespace JsonApiDotNetCore.OpenApi.JsonApiMetadata
44
{
55
internal sealed class PrimaryRequestMetadata : IJsonApiRequestMetadata
66
{
7-
public Type Type { get; init; }
7+
public Type Type { get; }
8+
9+
public PrimaryRequestMetadata(Type type)
10+
{
11+
Type = type;
12+
}
813
}
914
}

src/JsonApiDotNetCore.OpenApi/JsonApiMetadata/PrimaryResponseMetadata.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ namespace JsonApiDotNetCore.OpenApi.JsonApiMetadata
44
{
55
internal sealed class PrimaryResponseMetadata : IJsonApiResponseMetadata
66
{
7-
public Type Type { get; init; }
7+
public Type Type { get; }
8+
9+
public PrimaryResponseMetadata(Type type)
10+
{
11+
Type = type;
12+
}
813
}
914
}

src/JsonApiDotNetCore.OpenApi/JsonApiMetadata/RelationshipRequestMetadata.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ namespace JsonApiDotNetCore.OpenApi.JsonApiMetadata
55
{
66
internal sealed class RelationshipRequestMetadata : ExpansibleEndpointMetadata, IJsonApiRequestMetadata
77
{
8-
public IDictionary<string, Type> RequestBodyTypeByRelationshipName { get; init; }
8+
public override IDictionary<string, Type> ExpansionElements { get; }
99

10-
public override IDictionary<string, Type> ExpansionElements => RequestBodyTypeByRelationshipName;
10+
public RelationshipRequestMetadata(IDictionary<string, Type> requestBodyTypeByRelationshipName)
11+
{
12+
ExpansionElements = requestBodyTypeByRelationshipName;
13+
}
1114
}
1215
}

src/JsonApiDotNetCore.OpenApi/JsonApiMetadata/RelationshipResponseMetadata.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ namespace JsonApiDotNetCore.OpenApi.JsonApiMetadata
55
{
66
internal sealed class RelationshipResponseMetadata : ExpansibleEndpointMetadata, IJsonApiResponseMetadata
77
{
8-
public IDictionary<string, Type> ResponseTypesByRelationshipName { get; init; }
8+
public override IDictionary<string, Type> ExpansionElements { get; }
99

10-
public override IDictionary<string, Type> ExpansionElements => ResponseTypesByRelationshipName;
10+
public RelationshipResponseMetadata(IDictionary<string, Type> responseTypesByRelationshipName)
11+
{
12+
ExpansionElements = responseTypesByRelationshipName;
13+
}
1114
}
1215
}

src/JsonApiDotNetCore.OpenApi/JsonApiMetadata/SecondaryResponseMetadata.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ namespace JsonApiDotNetCore.OpenApi.JsonApiMetadata
55
{
66
internal sealed class SecondaryResponseMetadata : ExpansibleEndpointMetadata, IJsonApiResponseMetadata
77
{
8-
public IDictionary<string, Type> ResponseTypesByRelationshipName { get; init; }
8+
public override IDictionary<string, Type> ExpansionElements { get; }
99

10-
public override IDictionary<string, Type> ExpansionElements => ResponseTypesByRelationshipName;
10+
public SecondaryResponseMetadata(IDictionary<string, Type> responseTypesByRelationshipName)
11+
{
12+
ExpansionElements = responseTypesByRelationshipName;
13+
}
1114
}
1215
}

src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/PrimaryResourceResponseDocument.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
using JsonApiDotNetCore.OpenApi.JsonApiObjects.ResourceObjects;
66
using JsonApiDotNetCore.Resources;
77

8+
#pragma warning disable 8618 // Motivation: this type is meant to never be instantiated.
9+
810
namespace JsonApiDotNetCore.OpenApi.JsonApiObjects.Documents
911
{
1012
[UsedImplicitly(ImplicitUseTargetFlags.Members)]

src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/ResourceCollectionResponseDocument.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
using JsonApiDotNetCore.OpenApi.JsonApiObjects.ResourceObjects;
66
using JsonApiDotNetCore.Resources;
77

8+
#pragma warning disable 8618 // Motivation: this type is meant to never be instantiated.
9+
810
namespace JsonApiDotNetCore.OpenApi.JsonApiObjects.Documents
911
{
1012
[UsedImplicitly(ImplicitUseTargetFlags.Members)]

src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/ResourceIdentifierCollectionResponseDocument.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
using JsonApiDotNetCore.OpenApi.JsonApiObjects.ResourceObjects;
66
using JsonApiDotNetCore.Resources;
77

8+
#pragma warning disable 8618 // Motivation: this type is meant to never be instantiated.
9+
810
namespace JsonApiDotNetCore.OpenApi.JsonApiObjects.Documents
911
{
1012
[UsedImplicitly(ImplicitUseTargetFlags.Members)]

src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/ResourceIdentifierResponseDocument.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
using JsonApiDotNetCore.OpenApi.JsonApiObjects.ResourceObjects;
66
using JsonApiDotNetCore.Resources;
77

8+
#pragma warning disable 8618 // Motivation: this type is meant to never be instantiated.
9+
810
namespace JsonApiDotNetCore.OpenApi.JsonApiObjects.Documents
911
{
1012
[UsedImplicitly(ImplicitUseTargetFlags.Members)]

0 commit comments

Comments
 (0)