Skip to content

Commit

Permalink
Breaking: rename relaxed form of Atomic Operations extension from "at…
Browse files Browse the repository at this point in the history
…omic-operations" to "atomic" for consistency (#1664)
  • Loading branch information
bkoelman authored Jan 4, 2025
1 parent dc032d8 commit a01b268
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/JsonApiDotNetCore/Middleware/HeaderConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ public static class HeaderConstants
public const string AtomicOperationsMediaType = $"{MediaType}; ext=\"https://jsonapi.org/ext/atomic\"";

[Obsolete($"Use {nameof(JsonApiMediaType)}.{nameof(JsonApiMediaType.RelaxedAtomicOperations)}.ToString() instead.")]
public const string RelaxedAtomicOperationsMediaType = $"{MediaType}; ext=atomic-operations";
public const string RelaxedAtomicOperationsMediaType = $"{MediaType}; ext=atomic";
}
2 changes: 1 addition & 1 deletion src/JsonApiDotNetCore/Middleware/JsonApiMediaType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public sealed class JsonApiMediaType : IEquatable<JsonApiMediaType>
public static readonly JsonApiMediaType AtomicOperations = new([JsonApiMediaTypeExtension.AtomicOperations]);

/// <summary>
/// Gets the JSON:API media type with the "atomic-operations" extension.
/// Gets the JSON:API media type with the "atomic" extension.
/// </summary>
public static readonly JsonApiMediaType RelaxedAtomicOperations = new([JsonApiMediaTypeExtension.RelaxedAtomicOperations]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace JsonApiDotNetCore.Middleware;
public sealed class JsonApiMediaTypeExtension : IEquatable<JsonApiMediaTypeExtension>
{
public static readonly JsonApiMediaTypeExtension AtomicOperations = new("https://jsonapi.org/ext/atomic");
public static readonly JsonApiMediaTypeExtension RelaxedAtomicOperations = new("atomic-operations");
public static readonly JsonApiMediaTypeExtension RelaxedAtomicOperations = new("atomic");

public string UnescapedValue { get; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public async Task Prefers_JsonApi_with_AtomicOperations_extension_in_Accept_head
headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse($"{JsonApiMediaType.Default}; profile=some"));
headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse(JsonApiMediaType.Default.ToString()));
headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse($"{JsonApiMediaType.Default}; unknown=unexpected"));
headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse($"{JsonApiMediaType.Default};EXT=atomic-operations; q=0.8"));
headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse($"{JsonApiMediaType.Default};EXT=atomic; q=0.8"));
headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse($"{JsonApiMediaType.Default};EXT=\"https://jsonapi.org/ext/atomic\"; q=0.2"));
};

Expand Down Expand Up @@ -168,7 +168,7 @@ public async Task Prefers_JsonApi_with_relaxed_AtomicOperations_extension_in_Acc
headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse(JsonApiMediaType.Default.ToString()));
headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse($"{JsonApiMediaType.Default}; unknown=unexpected"));
headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse($"{JsonApiMediaType.Default};EXT=\"https://jsonapi.org/ext/atomic\"; q=0.8"));
headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse($"{JsonApiMediaType.Default};EXT=atomic-operations; q=0.2"));
headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse($"{JsonApiMediaType.Default};EXT=atomic; q=0.2"));
};

// Act
Expand Down

0 comments on commit a01b268

Please sign in to comment.