/// Patterns are similar to regular expressions, but a lot simpler. They consist of a sequence of terms. A term can be a single character or a character
- /// choice, optionally followed by a quantifier.
+ /// choice. A term is optionally followed by a quantifier.
///
/// The following characters can be used:
///
@@ -58,18 +58,26 @@ internal FieldChainPattern(FieldTypes choices, bool atLeastOne, bool atMostOne,
///
/// Matches a to-many relationship.
///
+ ///
+ /// -
/// O
///
/// Matches a to-one relationship.
///
+ ///
+ /// -
/// R
///
/// Matches a relationship.
///
+ ///
+ /// -
/// A
///
/// Matches an attribute.
///
+ ///
+ /// -
/// F
///
/// Matches a field.
@@ -86,15 +94,19 @@ internal FieldChainPattern(FieldTypes choices, bool atLeastOne, bool atMostOne,
///
-
/// ?
///
- /// Matches its term zero or one times.
+ /// Matches its preceding term zero or one times.
///
+ ///
+ /// -
/// *
///
- /// Matches its term zero or more times.
+ /// Matches its preceding term zero or more times.
///
+ ///
+ /// -
/// +
///
- /// Matches its term one or more times.
+ /// Matches its preceding term one or more times.
///
///
///
diff --git a/src/JsonApiDotNetCore/Serialization/Request/Adapters/IDocumentAdapter.cs b/src/JsonApiDotNetCore/Serialization/Request/Adapters/IDocumentAdapter.cs
index 794278fc73..5480d41c01 100644
--- a/src/JsonApiDotNetCore/Serialization/Request/Adapters/IDocumentAdapter.cs
+++ b/src/JsonApiDotNetCore/Serialization/Request/Adapters/IDocumentAdapter.cs
@@ -13,22 +13,22 @@ public interface IDocumentAdapter
///
/// -
///
- ///
]]>
(operations)
+ /// ]]> (operations)
///
///
/// -
///
- ///
]]>
(to-many relationship, unknown relationship)
+ /// ]]> (to-many relationship, unknown relationship)
///
///
/// -
///
- ///
(resource, to-one relationship)
+ /// (resource, to-one relationship)
///
///
/// -
///
- ///
(to-one relationship)
+ /// (to-one relationship)
///
///
///
diff --git a/src/JsonApiDotNetCore/Serialization/Response/IResponseModelAdapter.cs b/src/JsonApiDotNetCore/Serialization/Response/IResponseModelAdapter.cs
index f458edf33a..49b0f65c95 100644
--- a/src/JsonApiDotNetCore/Serialization/Response/IResponseModelAdapter.cs
+++ b/src/JsonApiDotNetCore/Serialization/Response/IResponseModelAdapter.cs
@@ -12,32 +12,32 @@ public interface IResponseModelAdapter
///
/// -
///
- ///
]]>
+ /// ]]>
///
///
/// -
///
- ///
+ ///
///
///
/// -
///
- ///
+ ///
///
///
/// -
///
- ///
]]>
+ /// ]]>
///
///
/// -
///
- ///
]]>
+ /// ]]>
///
///
/// -
///
- ///
+ ///
///
///
///
diff --git a/src/JsonApiDotNetCore/Serialization/Response/LinkBuilder.cs b/src/JsonApiDotNetCore/Serialization/Response/LinkBuilder.cs
index ffb8b8e9b7..27cf775d70 100644
--- a/src/JsonApiDotNetCore/Serialization/Response/LinkBuilder.cs
+++ b/src/JsonApiDotNetCore/Serialization/Response/LinkBuilder.cs
@@ -214,7 +214,7 @@ private string GetLinkForPagination(int pageOffset, string? pageSizeValue)
};
UriComponents components = _options.UseRelativeLinks ? UriComponents.PathAndQuery : UriComponents.AbsoluteUri;
- return builder.Uri.GetComponents(components, UriFormat.SafeUnescaped);
+ return builder.Uri.GetComponents(components, UriFormat.UriEscaped);
}
private string GetQueryStringInPaginationLink(int pageOffset, string? pageSizeValue)
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/Blobs/ImageContainer.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/Blobs/ImageContainer.cs
index 4ad0e54d5a..3462cdb2df 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/Blobs/ImageContainer.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/Blobs/ImageContainer.cs
@@ -12,7 +12,7 @@ public sealed class ImageContainer : Identifiable
public string FileName { get; set; } = null!;
[Attr]
- public byte[] Data { get; set; } = Array.Empty();
+ public byte[] Data { get; set; } = [];
[Attr]
public byte[]? Thumbnail { get; set; }
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/QueryStrings/Filtering/FilterOperatorTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/QueryStrings/Filtering/FilterOperatorTests.cs
index bc3c70c59a..a955baa230 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/QueryStrings/Filtering/FilterOperatorTests.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/QueryStrings/Filtering/FilterOperatorTests.cs
@@ -85,6 +85,10 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
responseDocument.Data.ManyValue.ShouldHaveCount(1);
responseDocument.Data.ManyValue[0].Attributes.ShouldContainKey("someString").With(value => value.Should().Be(resource.SomeString));
+
+ responseDocument.Links.ShouldNotBeNull();
+ responseDocument.Links.Self.Should().Be("http://localhost/filterableResources?filter=equals(someString,'This%2c+that+%26+more+%2b+some')");
+ responseDocument.Links.First.Should().Be("http://localhost/filterableResources?filter=equals(someString,%27This,%20that%20%26%20more%20%2B%20some%27)");
}
[Fact]
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/ResourceInheritance/ResourceInheritanceWriteTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/ResourceInheritance/ResourceInheritanceWriteTests.cs
index 0fcd65e701..0e55f5ad85 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/ResourceInheritance/ResourceInheritanceWriteTests.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/ResourceInheritance/ResourceInheritanceWriteTests.cs
@@ -1766,7 +1766,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
});
tandemStore.AssertLeftType();
- tandemStore.AssertRightTypes(Array.Empty());
+ tandemStore.AssertRightTypes([]);
}
[Fact]
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/ResourceInheritance/ResourceTypeCapturingDefinition.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/ResourceInheritance/ResourceTypeCapturingDefinition.cs
index e2754968a7..8e9a49dbfc 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/ResourceInheritance/ResourceTypeCapturingDefinition.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/ResourceInheritance/ResourceTypeCapturingDefinition.cs
@@ -82,7 +82,7 @@ public override Task OnWriteSucceededAsync(TResource resource, WriteOperationKin
private void EnsureSnapshot(TResource leftType, IIdentifiable? rightResourceId = null)
{
- IIdentifiable[] rightResourceIds = rightResourceId != null ? [rightResourceId] : Array.Empty();
+ IIdentifiable[] rightResourceIds = rightResourceId != null ? [rightResourceId] : [];
EnsureSnapshot(leftType, rightResourceIds);
}