From a01b2681570ebd66977a3dff8cc459831fa6e094 Mon Sep 17 00:00:00 2001 From: Bart Koelman <10324372+bkoelman@users.noreply.github.com> Date: Sat, 4 Jan 2025 09:33:23 +0100 Subject: [PATCH 1/2] Breaking: rename relaxed form of Atomic Operations extension from "atomic-operations" to "atomic" for consistency (#1664) --- src/JsonApiDotNetCore/Middleware/HeaderConstants.cs | 2 +- src/JsonApiDotNetCore/Middleware/JsonApiMediaType.cs | 2 +- src/JsonApiDotNetCore/Middleware/JsonApiMediaTypeExtension.cs | 2 +- .../IntegrationTests/ContentNegotiation/AcceptHeaderTests.cs | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/JsonApiDotNetCore/Middleware/HeaderConstants.cs b/src/JsonApiDotNetCore/Middleware/HeaderConstants.cs index 190efb74f2..05ddc69a6b 100644 --- a/src/JsonApiDotNetCore/Middleware/HeaderConstants.cs +++ b/src/JsonApiDotNetCore/Middleware/HeaderConstants.cs @@ -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"; } diff --git a/src/JsonApiDotNetCore/Middleware/JsonApiMediaType.cs b/src/JsonApiDotNetCore/Middleware/JsonApiMediaType.cs index d9661abffd..cfb2cb8b07 100644 --- a/src/JsonApiDotNetCore/Middleware/JsonApiMediaType.cs +++ b/src/JsonApiDotNetCore/Middleware/JsonApiMediaType.cs @@ -25,7 +25,7 @@ public sealed class JsonApiMediaType : IEquatable public static readonly JsonApiMediaType AtomicOperations = new([JsonApiMediaTypeExtension.AtomicOperations]); /// - /// Gets the JSON:API media type with the "atomic-operations" extension. + /// Gets the JSON:API media type with the "atomic" extension. /// public static readonly JsonApiMediaType RelaxedAtomicOperations = new([JsonApiMediaTypeExtension.RelaxedAtomicOperations]); diff --git a/src/JsonApiDotNetCore/Middleware/JsonApiMediaTypeExtension.cs b/src/JsonApiDotNetCore/Middleware/JsonApiMediaTypeExtension.cs index f35a613dc1..6ee7ac10ce 100644 --- a/src/JsonApiDotNetCore/Middleware/JsonApiMediaTypeExtension.cs +++ b/src/JsonApiDotNetCore/Middleware/JsonApiMediaTypeExtension.cs @@ -9,7 +9,7 @@ namespace JsonApiDotNetCore.Middleware; public sealed class JsonApiMediaTypeExtension : IEquatable { 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; } diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/ContentNegotiation/AcceptHeaderTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/ContentNegotiation/AcceptHeaderTests.cs index b1f92ffd9e..6927e811c9 100644 --- a/test/JsonApiDotNetCoreTests/IntegrationTests/ContentNegotiation/AcceptHeaderTests.cs +++ b/test/JsonApiDotNetCoreTests/IntegrationTests/ContentNegotiation/AcceptHeaderTests.cs @@ -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")); }; @@ -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 From 44c3f7146e8b15edda007b2a58d62db55438dc70 Mon Sep 17 00:00:00 2001 From: Bart Koelman <10324372+bkoelman@users.noreply.github.com> Date: Sat, 4 Jan 2025 09:40:26 +0100 Subject: [PATCH 2/2] Post-merge fixes --- .../GeneratedSwagger/JsonApiDotNetCoreExample.json | 14 +++++++------- .../Api/Operations/OperationsRequestBuilder.cs | 4 ++-- .../Operations/OperationsRequestBuilder.cs | 4 ++-- .../GeneratedSwagger/swagger.g.json | 14 +++++++------- .../AtomicOperations/OperationsTests.cs | 14 +++++++------- .../Documentation/ErrorResponseTests.cs | 2 +- .../NamingConventions/CamelCase/CamelCaseTests.cs | 4 ++-- .../CamelCase/GeneratedSwagger/swagger.g.json | 14 +++++++------- .../KebabCase/GeneratedSwagger/swagger.g.json | 14 +++++++------- .../NamingConventions/KebabCase/KebabCaseTests.cs | 4 ++-- .../PascalCase/GeneratedSwagger/swagger.g.json | 14 +++++++------- .../PascalCase/PascalCaseTests.cs | 4 ++-- 12 files changed, 53 insertions(+), 53 deletions(-) diff --git a/src/Examples/JsonApiDotNetCoreExample/GeneratedSwagger/JsonApiDotNetCoreExample.json b/src/Examples/JsonApiDotNetCoreExample/GeneratedSwagger/JsonApiDotNetCoreExample.json index e6ed281125..64fb730025 100644 --- a/src/Examples/JsonApiDotNetCoreExample/GeneratedSwagger/JsonApiDotNetCoreExample.json +++ b/src/Examples/JsonApiDotNetCoreExample/GeneratedSwagger/JsonApiDotNetCoreExample.json @@ -20,7 +20,7 @@ "requestBody": { "description": "An array of mutation operations. For syntax, see the [Atomic Operations documentation](https://jsonapi.org/ext/atomic/).", "content": { - "application/vnd.api+json; ext=atomic-operations": { + "application/vnd.api+json; ext=atomic": { "schema": { "allOf": [ { @@ -36,7 +36,7 @@ "200": { "description": "All operations were successfully applied, which resulted in additional changes.", "content": { - "application/vnd.api+json; ext=atomic-operations": { + "application/vnd.api+json; ext=atomic": { "schema": { "$ref": "#/components/schemas/operationsResponseDocument" } @@ -49,7 +49,7 @@ "400": { "description": "The request body is missing or malformed.", "content": { - "application/vnd.api+json; ext=atomic-operations": { + "application/vnd.api+json; ext=atomic": { "schema": { "$ref": "#/components/schemas/errorResponseDocument" } @@ -59,7 +59,7 @@ "403": { "description": "An operation is not accessible or a client-generated ID is used.", "content": { - "application/vnd.api+json; ext=atomic-operations": { + "application/vnd.api+json; ext=atomic": { "schema": { "$ref": "#/components/schemas/errorResponseDocument" } @@ -69,7 +69,7 @@ "404": { "description": "A resource or a related resource does not exist.", "content": { - "application/vnd.api+json; ext=atomic-operations": { + "application/vnd.api+json; ext=atomic": { "schema": { "$ref": "#/components/schemas/errorResponseDocument" } @@ -79,7 +79,7 @@ "409": { "description": "The request body contains conflicting information or another resource with the same ID already exists.", "content": { - "application/vnd.api+json; ext=atomic-operations": { + "application/vnd.api+json; ext=atomic": { "schema": { "$ref": "#/components/schemas/errorResponseDocument" } @@ -89,7 +89,7 @@ "422": { "description": "Validation of the request body failed.", "content": { - "application/vnd.api+json; ext=atomic-operations": { + "application/vnd.api+json; ext=atomic": { "schema": { "$ref": "#/components/schemas/errorResponseDocument" } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Operations/OperationsRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Operations/OperationsRequestBuilder.cs index 3fe71b454d..89a52a9b2a 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Operations/OperationsRequestBuilder.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Operations/OperationsRequestBuilder.cs @@ -84,8 +84,8 @@ public RequestInformation ToPostRequestInformation(global::OpenApiKiotaClientExa _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); requestInfo.Configure(requestConfiguration); - requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json;ext=atomic-operations"); - requestInfo.SetContentFromParsable(RequestAdapter, "application/vnd.api+json;ext=atomic-operations", body); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json;ext=atomic"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/vnd.api+json;ext=atomic", body); return requestInfo; } /// diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Operations/OperationsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Operations/OperationsRequestBuilder.cs index d0de8edbf8..b10c9c4f55 100644 --- a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Operations/OperationsRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Operations/OperationsRequestBuilder.cs @@ -84,8 +84,8 @@ public RequestInformation ToPostRequestInformation(global::OpenApiKiotaEndToEndT _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); requestInfo.Configure(requestConfiguration); - requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json;ext=atomic-operations"); - requestInfo.SetContentFromParsable(RequestAdapter, "application/vnd.api+json;ext=atomic-operations", body); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json;ext=atomic"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/vnd.api+json;ext=atomic", body); return requestInfo; } /// diff --git a/test/OpenApiTests/AtomicOperations/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/AtomicOperations/GeneratedSwagger/swagger.g.json index 60401db8d4..c8619234c0 100644 --- a/test/OpenApiTests/AtomicOperations/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/AtomicOperations/GeneratedSwagger/swagger.g.json @@ -2996,7 +2996,7 @@ "requestBody": { "description": "An array of mutation operations. For syntax, see the [Atomic Operations documentation](https://jsonapi.org/ext/atomic/).", "content": { - "application/vnd.api+json; ext=atomic-operations": { + "application/vnd.api+json; ext=atomic": { "schema": { "allOf": [ { @@ -3012,7 +3012,7 @@ "200": { "description": "All operations were successfully applied, which resulted in additional changes.", "content": { - "application/vnd.api+json; ext=atomic-operations": { + "application/vnd.api+json; ext=atomic": { "schema": { "$ref": "#/components/schemas/operationsResponseDocument" } @@ -3025,7 +3025,7 @@ "400": { "description": "The request body is missing or malformed.", "content": { - "application/vnd.api+json; ext=atomic-operations": { + "application/vnd.api+json; ext=atomic": { "schema": { "$ref": "#/components/schemas/errorResponseDocument" } @@ -3035,7 +3035,7 @@ "403": { "description": "An operation is not accessible or a client-generated ID is used.", "content": { - "application/vnd.api+json; ext=atomic-operations": { + "application/vnd.api+json; ext=atomic": { "schema": { "$ref": "#/components/schemas/errorResponseDocument" } @@ -3045,7 +3045,7 @@ "404": { "description": "A resource or a related resource does not exist.", "content": { - "application/vnd.api+json; ext=atomic-operations": { + "application/vnd.api+json; ext=atomic": { "schema": { "$ref": "#/components/schemas/errorResponseDocument" } @@ -3055,7 +3055,7 @@ "409": { "description": "The request body contains conflicting information or another resource with the same ID already exists.", "content": { - "application/vnd.api+json; ext=atomic-operations": { + "application/vnd.api+json; ext=atomic": { "schema": { "$ref": "#/components/schemas/errorResponseDocument" } @@ -3065,7 +3065,7 @@ "422": { "description": "Validation of the request body failed.", "content": { - "application/vnd.api+json; ext=atomic-operations": { + "application/vnd.api+json; ext=atomic": { "schema": { "$ref": "#/components/schemas/errorResponseDocument" } diff --git a/test/OpenApiTests/AtomicOperations/OperationsTests.cs b/test/OpenApiTests/AtomicOperations/OperationsTests.cs index 42bcdfdb56..749b3d804d 100644 --- a/test/OpenApiTests/AtomicOperations/OperationsTests.cs +++ b/test/OpenApiTests/AtomicOperations/OperationsTests.cs @@ -41,7 +41,7 @@ public async Task Operations_endpoint_is_exposed() "requestBody": { "description": "An array of mutation operations. For syntax, see the [Atomic Operations documentation](https://jsonapi.org/ext/atomic/).", "content": { - "application/vnd.api+json; ext=atomic-operations": { + "application/vnd.api+json; ext=atomic": { "schema": { "allOf": [ { @@ -57,7 +57,7 @@ public async Task Operations_endpoint_is_exposed() "200": { "description": "All operations were successfully applied, which resulted in additional changes.", "content": { - "application/vnd.api+json; ext=atomic-operations": { + "application/vnd.api+json; ext=atomic": { "schema": { "$ref": "#/components/schemas/operationsResponseDocument" } @@ -70,7 +70,7 @@ public async Task Operations_endpoint_is_exposed() "400": { "description": "The request body is missing or malformed.", "content": { - "application/vnd.api+json; ext=atomic-operations": { + "application/vnd.api+json; ext=atomic": { "schema": { "$ref": "#/components/schemas/errorResponseDocument" } @@ -80,7 +80,7 @@ public async Task Operations_endpoint_is_exposed() "403": { "description": "An operation is not accessible or a client-generated ID is used.", "content": { - "application/vnd.api+json; ext=atomic-operations": { + "application/vnd.api+json; ext=atomic": { "schema": { "$ref": "#/components/schemas/errorResponseDocument" } @@ -90,7 +90,7 @@ public async Task Operations_endpoint_is_exposed() "404": { "description": "A resource or a related resource does not exist.", "content": { - "application/vnd.api+json; ext=atomic-operations": { + "application/vnd.api+json; ext=atomic": { "schema": { "$ref": "#/components/schemas/errorResponseDocument" } @@ -100,7 +100,7 @@ public async Task Operations_endpoint_is_exposed() "409": { "description": "The request body contains conflicting information or another resource with the same ID already exists.", "content": { - "application/vnd.api+json; ext=atomic-operations": { + "application/vnd.api+json; ext=atomic": { "schema": { "$ref": "#/components/schemas/errorResponseDocument" } @@ -110,7 +110,7 @@ public async Task Operations_endpoint_is_exposed() "422": { "description": "Validation of the request body failed.", "content": { - "application/vnd.api+json; ext=atomic-operations": { + "application/vnd.api+json; ext=atomic": { "schema": { "$ref": "#/components/schemas/errorResponseDocument" } diff --git a/test/OpenApiTests/Documentation/ErrorResponseTests.cs b/test/OpenApiTests/Documentation/ErrorResponseTests.cs index e7b6765fac..7c76fce808 100644 --- a/test/OpenApiTests/Documentation/ErrorResponseTests.cs +++ b/test/OpenApiTests/Documentation/ErrorResponseTests.cs @@ -8,7 +8,7 @@ namespace OpenApiTests.Documentation; public sealed class ErrorResponseTests : IClassFixture, DocumentationDbContext>> { private const string EscapedJsonApiMediaType = "['application/vnd.api+json']"; - private const string EscapedOperationsMediaType = "['application/vnd.api+json; ext=atomic-operations']"; + private const string EscapedOperationsMediaType = "['application/vnd.api+json; ext=atomic']"; private readonly OpenApiTestContext, DocumentationDbContext> _testContext; diff --git a/test/OpenApiTests/NamingConventions/CamelCase/CamelCaseTests.cs b/test/OpenApiTests/NamingConventions/CamelCase/CamelCaseTests.cs index 7b95b8a312..602da50581 100644 --- a/test/OpenApiTests/NamingConventions/CamelCase/CamelCaseTests.cs +++ b/test/OpenApiTests/NamingConventions/CamelCase/CamelCaseTests.cs @@ -566,10 +566,10 @@ public async Task Casing_convention_is_applied_to_PostOperations_endpoint() operationElement.Should().Be("postOperations"); }); - getElement.Should().ContainPath("requestBody.content['application/vnd.api+json; ext=atomic-operations'].schema.allOf[0].$ref") + getElement.Should().ContainPath("requestBody.content['application/vnd.api+json; ext=atomic'].schema.allOf[0].$ref") .ShouldBeSchemaReferenceId("operationsRequestDocument"); - getElement.Should().ContainPath("responses.200.content['application/vnd.api+json; ext=atomic-operations'].schema.$ref") + getElement.Should().ContainPath("responses.200.content['application/vnd.api+json; ext=atomic'].schema.$ref") .ShouldBeSchemaReferenceId("operationsResponseDocument"); }); diff --git a/test/OpenApiTests/NamingConventions/CamelCase/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/NamingConventions/CamelCase/GeneratedSwagger/swagger.g.json index 52afa1a60c..ec02414fe2 100644 --- a/test/OpenApiTests/NamingConventions/CamelCase/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/NamingConventions/CamelCase/GeneratedSwagger/swagger.g.json @@ -20,7 +20,7 @@ "requestBody": { "description": "An array of mutation operations. For syntax, see the [Atomic Operations documentation](https://jsonapi.org/ext/atomic/).", "content": { - "application/vnd.api+json; ext=atomic-operations": { + "application/vnd.api+json; ext=atomic": { "schema": { "allOf": [ { @@ -36,7 +36,7 @@ "200": { "description": "All operations were successfully applied, which resulted in additional changes.", "content": { - "application/vnd.api+json; ext=atomic-operations": { + "application/vnd.api+json; ext=atomic": { "schema": { "$ref": "#/components/schemas/operationsResponseDocument" } @@ -49,7 +49,7 @@ "400": { "description": "The request body is missing or malformed.", "content": { - "application/vnd.api+json; ext=atomic-operations": { + "application/vnd.api+json; ext=atomic": { "schema": { "$ref": "#/components/schemas/errorResponseDocument" } @@ -59,7 +59,7 @@ "403": { "description": "An operation is not accessible or a client-generated ID is used.", "content": { - "application/vnd.api+json; ext=atomic-operations": { + "application/vnd.api+json; ext=atomic": { "schema": { "$ref": "#/components/schemas/errorResponseDocument" } @@ -69,7 +69,7 @@ "404": { "description": "A resource or a related resource does not exist.", "content": { - "application/vnd.api+json; ext=atomic-operations": { + "application/vnd.api+json; ext=atomic": { "schema": { "$ref": "#/components/schemas/errorResponseDocument" } @@ -79,7 +79,7 @@ "409": { "description": "The request body contains conflicting information or another resource with the same ID already exists.", "content": { - "application/vnd.api+json; ext=atomic-operations": { + "application/vnd.api+json; ext=atomic": { "schema": { "$ref": "#/components/schemas/errorResponseDocument" } @@ -89,7 +89,7 @@ "422": { "description": "Validation of the request body failed.", "content": { - "application/vnd.api+json; ext=atomic-operations": { + "application/vnd.api+json; ext=atomic": { "schema": { "$ref": "#/components/schemas/errorResponseDocument" } diff --git a/test/OpenApiTests/NamingConventions/KebabCase/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/NamingConventions/KebabCase/GeneratedSwagger/swagger.g.json index 883b69cc33..b14a9a0ff4 100644 --- a/test/OpenApiTests/NamingConventions/KebabCase/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/NamingConventions/KebabCase/GeneratedSwagger/swagger.g.json @@ -20,7 +20,7 @@ "requestBody": { "description": "An array of mutation operations. For syntax, see the [Atomic Operations documentation](https://jsonapi.org/ext/atomic/).", "content": { - "application/vnd.api+json; ext=atomic-operations": { + "application/vnd.api+json; ext=atomic": { "schema": { "allOf": [ { @@ -36,7 +36,7 @@ "200": { "description": "All operations were successfully applied, which resulted in additional changes.", "content": { - "application/vnd.api+json; ext=atomic-operations": { + "application/vnd.api+json; ext=atomic": { "schema": { "$ref": "#/components/schemas/operations-response-document" } @@ -49,7 +49,7 @@ "400": { "description": "The request body is missing or malformed.", "content": { - "application/vnd.api+json; ext=atomic-operations": { + "application/vnd.api+json; ext=atomic": { "schema": { "$ref": "#/components/schemas/error-response-document" } @@ -59,7 +59,7 @@ "403": { "description": "An operation is not accessible or a client-generated ID is used.", "content": { - "application/vnd.api+json; ext=atomic-operations": { + "application/vnd.api+json; ext=atomic": { "schema": { "$ref": "#/components/schemas/error-response-document" } @@ -69,7 +69,7 @@ "404": { "description": "A resource or a related resource does not exist.", "content": { - "application/vnd.api+json; ext=atomic-operations": { + "application/vnd.api+json; ext=atomic": { "schema": { "$ref": "#/components/schemas/error-response-document" } @@ -79,7 +79,7 @@ "409": { "description": "The request body contains conflicting information or another resource with the same ID already exists.", "content": { - "application/vnd.api+json; ext=atomic-operations": { + "application/vnd.api+json; ext=atomic": { "schema": { "$ref": "#/components/schemas/error-response-document" } @@ -89,7 +89,7 @@ "422": { "description": "Validation of the request body failed.", "content": { - "application/vnd.api+json; ext=atomic-operations": { + "application/vnd.api+json; ext=atomic": { "schema": { "$ref": "#/components/schemas/error-response-document" } diff --git a/test/OpenApiTests/NamingConventions/KebabCase/KebabCaseTests.cs b/test/OpenApiTests/NamingConventions/KebabCase/KebabCaseTests.cs index 6200c0c7fe..1fa5f35396 100644 --- a/test/OpenApiTests/NamingConventions/KebabCase/KebabCaseTests.cs +++ b/test/OpenApiTests/NamingConventions/KebabCase/KebabCaseTests.cs @@ -568,10 +568,10 @@ public async Task Casing_convention_is_applied_to_PostOperations_endpoint() operationElement.Should().Be("post-operations"); }); - getElement.Should().ContainPath("requestBody.content['application/vnd.api+json; ext=atomic-operations'].schema.allOf[0].$ref") + getElement.Should().ContainPath("requestBody.content['application/vnd.api+json; ext=atomic'].schema.allOf[0].$ref") .ShouldBeSchemaReferenceId("operations-request-document"); - getElement.Should().ContainPath("responses.200.content['application/vnd.api+json; ext=atomic-operations'].schema.$ref") + getElement.Should().ContainPath("responses.200.content['application/vnd.api+json; ext=atomic'].schema.$ref") .ShouldBeSchemaReferenceId("operations-response-document"); }); diff --git a/test/OpenApiTests/NamingConventions/PascalCase/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/NamingConventions/PascalCase/GeneratedSwagger/swagger.g.json index 74bb6e8566..bd9aab2c39 100644 --- a/test/OpenApiTests/NamingConventions/PascalCase/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/NamingConventions/PascalCase/GeneratedSwagger/swagger.g.json @@ -20,7 +20,7 @@ "requestBody": { "description": "An array of mutation operations. For syntax, see the [Atomic Operations documentation](https://jsonapi.org/ext/atomic/).", "content": { - "application/vnd.api+json; ext=atomic-operations": { + "application/vnd.api+json; ext=atomic": { "schema": { "allOf": [ { @@ -36,7 +36,7 @@ "200": { "description": "All operations were successfully applied, which resulted in additional changes.", "content": { - "application/vnd.api+json; ext=atomic-operations": { + "application/vnd.api+json; ext=atomic": { "schema": { "$ref": "#/components/schemas/OperationsResponseDocument" } @@ -49,7 +49,7 @@ "400": { "description": "The request body is missing or malformed.", "content": { - "application/vnd.api+json; ext=atomic-operations": { + "application/vnd.api+json; ext=atomic": { "schema": { "$ref": "#/components/schemas/ErrorResponseDocument" } @@ -59,7 +59,7 @@ "403": { "description": "An operation is not accessible or a client-generated ID is used.", "content": { - "application/vnd.api+json; ext=atomic-operations": { + "application/vnd.api+json; ext=atomic": { "schema": { "$ref": "#/components/schemas/ErrorResponseDocument" } @@ -69,7 +69,7 @@ "404": { "description": "A resource or a related resource does not exist.", "content": { - "application/vnd.api+json; ext=atomic-operations": { + "application/vnd.api+json; ext=atomic": { "schema": { "$ref": "#/components/schemas/ErrorResponseDocument" } @@ -79,7 +79,7 @@ "409": { "description": "The request body contains conflicting information or another resource with the same ID already exists.", "content": { - "application/vnd.api+json; ext=atomic-operations": { + "application/vnd.api+json; ext=atomic": { "schema": { "$ref": "#/components/schemas/ErrorResponseDocument" } @@ -89,7 +89,7 @@ "422": { "description": "Validation of the request body failed.", "content": { - "application/vnd.api+json; ext=atomic-operations": { + "application/vnd.api+json; ext=atomic": { "schema": { "$ref": "#/components/schemas/ErrorResponseDocument" } diff --git a/test/OpenApiTests/NamingConventions/PascalCase/PascalCaseTests.cs b/test/OpenApiTests/NamingConventions/PascalCase/PascalCaseTests.cs index 43b821e992..c50c8a9e6c 100644 --- a/test/OpenApiTests/NamingConventions/PascalCase/PascalCaseTests.cs +++ b/test/OpenApiTests/NamingConventions/PascalCase/PascalCaseTests.cs @@ -566,10 +566,10 @@ public async Task Casing_convention_is_applied_to_PostOperations_endpoint() operationElement.Should().Be("PostOperations"); }); - getElement.Should().ContainPath("requestBody.content['application/vnd.api+json; ext=atomic-operations'].schema.allOf[0].$ref") + getElement.Should().ContainPath("requestBody.content['application/vnd.api+json; ext=atomic'].schema.allOf[0].$ref") .ShouldBeSchemaReferenceId("OperationsRequestDocument"); - getElement.Should().ContainPath("responses.200.content['application/vnd.api+json; ext=atomic-operations'].schema.$ref") + getElement.Should().ContainPath("responses.200.content['application/vnd.api+json; ext=atomic'].schema.$ref") .ShouldBeSchemaReferenceId("OperationsResponseDocument"); });