From 4c5d782b45b6a2bd7013ca9b6ad375fcf73e3fcf Mon Sep 17 00:00:00 2001 From: Irvine Sunday Date: Tue, 11 Aug 2020 15:57:51 +0300 Subject: [PATCH 01/14] Switch $ref operation from PATCH to PUT See: http://docs.oasis-open.org/odata/odata/v4.0/os/part1-protocol/odata-v4.0-os-part1-protocol.html#_Toc372793759 --- .../Operation/OperationHandlerProvider.cs | 4 ++-- ...{RefPatchOperationHandler.cs => RefPutOperationHandler.cs} | 4 ++-- .../PathItem/RefPathItemHandler.cs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) rename src/Microsoft.OpenApi.OData.Reader/Operation/{RefPatchOperationHandler.cs => RefPutOperationHandler.cs} (96%) diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/OperationHandlerProvider.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/OperationHandlerProvider.cs index 8679e01d..0737c13b 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Operation/OperationHandlerProvider.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Operation/OperationHandlerProvider.cs @@ -68,11 +68,11 @@ public OperationHandlerProvider() {OperationType.Delete, new NavigationPropertyDeleteOperationHandler() } }; - // navigatoin property ref (Get/Post/Patch/Delete) + // navigati0n property ref (Get/Post/Put/Delete) _handlers[ODataPathKind.Ref] = new Dictionary { {OperationType.Get, new RefGetOperationHandler() }, - {OperationType.Patch, new RefPatchOperationHandler() }, + {OperationType.Put, new RefPutOperationHandler() }, {OperationType.Post, new RefPostOperationHandler() }, {OperationType.Delete, new RefDeleteOperationHandler() } }; diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/RefPatchOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/RefPutOperationHandler.cs similarity index 96% rename from src/Microsoft.OpenApi.OData.Reader/Operation/RefPatchOperationHandler.cs rename to src/Microsoft.OpenApi.OData.Reader/Operation/RefPutOperationHandler.cs index 74aa410e..5dc0ac44 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Operation/RefPatchOperationHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Operation/RefPutOperationHandler.cs @@ -14,7 +14,7 @@ namespace Microsoft.OpenApi.OData.Operation /// /// Update a navigation property ref for a navigation source. /// - internal class RefPatchOperationHandler : NavigationPropertyOperationHandler + internal class RefPutOperationHandler : NavigationPropertyOperationHandler { /// public override OperationType OperationType => OperationType.Patch; @@ -40,7 +40,7 @@ protected override void SetRequestBody(OpenApiOperation operation) { OpenApiSchema schema = new OpenApiSchema { - Type = "String" + Type = "object" }; operation.RequestBody = new OpenApiRequestBody diff --git a/src/Microsoft.OpenApi.OData.Reader/PathItem/RefPathItemHandler.cs b/src/Microsoft.OpenApi.OData.Reader/PathItem/RefPathItemHandler.cs index 64356621..805eef8f 100644 --- a/src/Microsoft.OpenApi.OData.Reader/PathItem/RefPathItemHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/PathItem/RefPathItemHandler.cs @@ -90,7 +90,7 @@ protected override void SetOperations(OpenApiPathItem item) UpdateRestrictionsType update = restriction?.UpdateRestrictions; if (update == null || update.IsUpdatable) { - AddOperation(item, OperationType.Patch); + AddOperation(item, OperationType.Put); } } From a32c9616da103f95d5367799620ce34c373cb2d9 Mon Sep 17 00:00:00 2001 From: Irvine Sunday Date: Tue, 11 Aug 2020 15:58:14 +0300 Subject: [PATCH 02/14] Typo fix --- src/Microsoft.OpenApi.OData.Reader/PathItem/PathItemHandler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/PathItem/PathItemHandler.cs b/src/Microsoft.OpenApi.OData.Reader/PathItem/PathItemHandler.cs index a65bd827..eff041bc 100644 --- a/src/Microsoft.OpenApi.OData.Reader/PathItem/PathItemHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/PathItem/PathItemHandler.cs @@ -80,7 +80,7 @@ protected virtual void SetExtensions(OpenApiPathItem item) /// Add one operation into path item. /// /// The path item. - /// The operatin type. + /// The operation type. protected virtual void AddOperation(OpenApiPathItem item, OperationType operationType) { IOperationHandlerProvider provider = Context.OperationHanderProvider; From a3f29d673ee0bc4fa48674947b07f22905302388 Mon Sep 17 00:00:00 2001 From: Irvine Sunday Date: Tue, 11 Aug 2020 15:59:51 +0300 Subject: [PATCH 03/14] Update tests and test class names appropriately --- .../Operation/OperationHandlerProviderTests.cs | 2 +- ...tionHandlerTests.cs => RefPutOperationHandlerTests.cs} | 8 +++----- .../PathItem/RefPathItemHandlerTests.cs | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) rename test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/{RefPatchOperationHandlerTests.cs => RefPutOperationHandlerTests.cs} (88%) diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/OperationHandlerProviderTests.cs b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/OperationHandlerProviderTests.cs index 942cfdd7..ca6e588b 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/OperationHandlerProviderTests.cs +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/OperationHandlerProviderTests.cs @@ -31,7 +31,7 @@ public class OperationHandlerProviderTests [InlineData(ODataPathKind.Ref, OperationType.Post, typeof(RefPostOperationHandler))] [InlineData(ODataPathKind.Ref, OperationType.Delete, typeof(RefDeleteOperationHandler))] [InlineData(ODataPathKind.Ref, OperationType.Get, typeof(RefGetOperationHandler))] - [InlineData(ODataPathKind.Ref, OperationType.Patch, typeof(RefPatchOperationHandler))] + [InlineData(ODataPathKind.Ref, OperationType.Put, typeof(RefPutOperationHandler))] public void GetHandlerReturnsCorrectOperationHandlerType(ODataPathKind pathKind, OperationType operationType, Type handlerType) { // Arrange diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/RefPatchOperationHandlerTests.cs b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/RefPutOperationHandlerTests.cs similarity index 88% rename from test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/RefPatchOperationHandlerTests.cs rename to test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/RefPutOperationHandlerTests.cs index cacd40a0..f0333759 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/RefPatchOperationHandlerTests.cs +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/RefPutOperationHandlerTests.cs @@ -4,23 +4,21 @@ // ------------------------------------------------------------ using Microsoft.OData.Edm; -using Microsoft.OpenApi.Extensions; using Microsoft.OpenApi.OData.Edm; -using Microsoft.OpenApi.OData.PathItem.Tests; using Microsoft.OpenApi.OData.Tests; using System.Linq; using Xunit; namespace Microsoft.OpenApi.OData.Operation.Tests { - public class RefPatchOperationHandlerTests + public class RefPutOperationHandlerTests { - private RefPatchOperationHandler _operationHandler = new RefPatchOperationHandler(); + private RefPutOperationHandler _operationHandler = new RefPutOperationHandler(); [Theory] [InlineData(true)] [InlineData(false)] - public void CreateNavigationRefPatchOperationReturnsCorrectOperation(bool enableOperationId) + public void CreateNavigationRefPutOperationReturnsCorrectOperation(bool enableOperationId) { // Arrange IEdmModel model = EdmModelHelper.TripServiceModel; diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/PathItem/RefPathItemHandlerTests.cs b/test/Microsoft.OpenAPI.OData.Reader.Tests/PathItem/RefPathItemHandlerTests.cs index 30869c2a..d29e3954 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/PathItem/RefPathItemHandlerTests.cs +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/PathItem/RefPathItemHandlerTests.cs @@ -58,7 +58,7 @@ public void CreatePathItemThrowsForNonNavigationPropertyPath() [Theory] [InlineData(true, new OperationType[] { OperationType.Get, OperationType.Post, OperationType.Delete })] - [InlineData(false, new OperationType[] { OperationType.Get, OperationType.Patch, OperationType.Delete })] + [InlineData(false, new OperationType[] { OperationType.Get, OperationType.Put, OperationType.Delete })] public void CreateNavigationPropertyRefPathItemReturnsCorrectPathItem(bool collectionNav, OperationType[] expected) { // Arrange From fe1c3a36a58d36ae17df38e01d33576c44195b64 Mon Sep 17 00:00:00 2001 From: Irvine Sunday Date: Tue, 11 Aug 2020 16:00:31 +0300 Subject: [PATCH 04/14] Update test resource files appropriately --- .../Resources/Multiple.Schema.OpenApi.V2.json | 4 ++-- .../Resources/Multiple.Schema.OpenApi.V2.yaml | 4 ++-- .../Resources/Multiple.Schema.OpenApi.json | 4 ++-- .../Resources/Multiple.Schema.OpenApi.yaml | 4 ++-- .../Resources/TripService.OpenApi.V2.json | 12 ++++++------ .../Resources/TripService.OpenApi.V2.yaml | 12 ++++++------ .../Resources/TripService.OpenApi.json | 12 ++++++------ .../Resources/TripService.OpenApi.yaml | 12 ++++++------ 8 files changed, 32 insertions(+), 32 deletions(-) diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json index 0e8b96b8..12913238 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json @@ -2245,7 +2245,7 @@ }, "x-ms-docs-operation-type": "operation" }, - "patch": { + "put": { "tags": [ "Revisions.Document" ], @@ -2272,7 +2272,7 @@ "description": "New navigation property ref values", "required": true, "schema": { - "type": "String" + "type": "object" } } ], diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml index 19f76f4d..20963d82 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml @@ -1632,7 +1632,7 @@ paths: default: $ref: '#/responses/error' x-ms-docs-operation-type: operation - patch: + put: tags: - Revisions.Document summary: Update the ref of navigation property Document in Revisions @@ -1654,7 +1654,7 @@ paths: description: New navigation property ref values required: true schema: - type: String + type: object responses: '204': description: Success diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json index 2d9ce89a..0467b7b8 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json @@ -2597,7 +2597,7 @@ }, "x-ms-docs-operation-type": "operation" }, - "patch": { + "put": { "tags": [ "Revisions.Document" ], @@ -2623,7 +2623,7 @@ "content": { "application/json": { "schema": { - "type": "String" + "type": "object" } } }, diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml index 47d8e433..6136e7be 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml @@ -1857,7 +1857,7 @@ paths: default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation - patch: + put: tags: - Revisions.Document summary: Update the ref of navigation property Document in Revisions @@ -1878,7 +1878,7 @@ paths: content: application/json: schema: - type: String + type: object required: true responses: '204': diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json index 711b8c74..1a778246 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json @@ -774,7 +774,7 @@ }, "x-ms-docs-operation-type": "operation" }, - "patch": { + "put": { "tags": [ "Me.Person" ], @@ -790,7 +790,7 @@ "description": "New navigation property ref values", "required": true, "schema": { - "type": "String" + "type": "object" } } ], @@ -2134,7 +2134,7 @@ }, "x-ms-docs-operation-type": "operation" }, - "patch": { + "put": { "tags": [ "NewComePeople.Person" ], @@ -2158,7 +2158,7 @@ "description": "New navigation property ref values", "required": true, "schema": { - "type": "String" + "type": "object" } } ], @@ -3640,7 +3640,7 @@ }, "x-ms-docs-operation-type": "operation" }, - "patch": { + "put": { "tags": [ "People.Person" ], @@ -3664,7 +3664,7 @@ "description": "New navigation property ref values", "required": true, "schema": { - "type": "String" + "type": "object" } } ], diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml index 0cb2eff2..ac1b4ec2 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml @@ -525,7 +525,7 @@ paths: default: $ref: '#/responses/error' x-ms-docs-operation-type: operation - patch: + put: tags: - Me.Person summary: Update the ref of navigation property BestFriend in Me @@ -538,7 +538,7 @@ paths: description: New navigation property ref values required: true schema: - type: String + type: object responses: '204': description: Success @@ -1474,7 +1474,7 @@ paths: default: $ref: '#/responses/error' x-ms-docs-operation-type: operation - patch: + put: tags: - NewComePeople.Person summary: Update the ref of navigation property BestFriend in NewComePeople @@ -1493,7 +1493,7 @@ paths: description: New navigation property ref values required: true schema: - type: String + type: object responses: '204': description: Success @@ -2532,7 +2532,7 @@ paths: default: $ref: '#/responses/error' x-ms-docs-operation-type: operation - patch: + put: tags: - People.Person summary: Update the ref of navigation property BestFriend in People @@ -2551,7 +2551,7 @@ paths: description: New navigation property ref values required: true schema: - type: String + type: object responses: '204': description: Success diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json index 2d306233..e1daa1e9 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json @@ -904,7 +904,7 @@ }, "x-ms-docs-operation-type": "operation" }, - "patch": { + "put": { "tags": [ "Me.Person" ], @@ -915,7 +915,7 @@ "content": { "application/json": { "schema": { - "type": "String" + "type": "object" } } }, @@ -2410,7 +2410,7 @@ }, "x-ms-docs-operation-type": "operation" }, - "patch": { + "put": { "tags": [ "NewComePeople.Person" ], @@ -2433,7 +2433,7 @@ "content": { "application/json": { "schema": { - "type": "String" + "type": "object" } } }, @@ -4108,7 +4108,7 @@ }, "x-ms-docs-operation-type": "operation" }, - "patch": { + "put": { "tags": [ "People.Person" ], @@ -4131,7 +4131,7 @@ "content": { "application/json": { "schema": { - "type": "String" + "type": "object" } } }, diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml index ec59ccc8..c036753a 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml @@ -599,7 +599,7 @@ paths: default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation - patch: + put: tags: - Me.Person summary: Update the ref of navigation property BestFriend in Me @@ -609,7 +609,7 @@ paths: content: application/json: schema: - type: String + type: object required: true responses: '204': @@ -1635,7 +1635,7 @@ paths: default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation - patch: + put: tags: - NewComePeople.Person summary: Update the ref of navigation property BestFriend in NewComePeople @@ -1653,7 +1653,7 @@ paths: content: application/json: schema: - type: String + type: object required: true responses: '204': @@ -2803,7 +2803,7 @@ paths: default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation - patch: + put: tags: - People.Person summary: Update the ref of navigation property BestFriend in People @@ -2821,7 +2821,7 @@ paths: content: application/json: schema: - type: String + type: object required: true responses: '204': From 1c8fd9bc9a0b7f964ed7da5b46c139d4e57bc4de Mon Sep 17 00:00:00 2001 From: Irvine Sunday Date: Tue, 11 Aug 2020 18:57:43 +0300 Subject: [PATCH 05/14] Change schema type from 'String' to 'object' --- .../Operation/RefPostOperationHandler.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/RefPostOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/RefPostOperationHandler.cs index 33226765..72b52836 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Operation/RefPostOperationHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Operation/RefPostOperationHandler.cs @@ -40,7 +40,7 @@ protected override void SetRequestBody(OpenApiOperation operation) { OpenApiSchema schema = new OpenApiSchema { - Type = "String" + Type = "object" }; operation.RequestBody = new OpenApiRequestBody @@ -66,7 +66,7 @@ protected override void SetResponses(OpenApiOperation operation) { OpenApiSchema schema = new OpenApiSchema { - Type = "String" // What to return? + Type = "object" // What to return? }; operation.Responses = new OpenApiResponses From 0034227fde0a3e2955794995a4fbf26deb10a3c1 Mon Sep 17 00:00:00 2001 From: Irvine Sunday Date: Tue, 11 Aug 2020 18:58:56 +0300 Subject: [PATCH 06/14] Delete operations are only valid for non-collection of navProps --- .../PathItem/RefPathItemHandler.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/PathItem/RefPathItemHandler.cs b/src/Microsoft.OpenApi.OData.Reader/PathItem/RefPathItemHandler.cs index 805eef8f..60a18bf2 100644 --- a/src/Microsoft.OpenApi.OData.Reader/PathItem/RefPathItemHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/PathItem/RefPathItemHandler.cs @@ -92,13 +92,13 @@ protected override void SetOperations(OpenApiPathItem item) { AddOperation(item, OperationType.Put); } - } - // delete the link - DeleteRestrictionsType delete = restriction?.DeleteRestrictions; - if (delete == null || delete.IsDeletable) - { - AddOperation(item, OperationType.Delete); + // delete the link + DeleteRestrictionsType delete = restriction?.DeleteRestrictions; + if (delete == null || delete.IsDeletable) + { + AddOperation(item, OperationType.Delete); + } } } From 3d95b5b20ce292fb07fb40a8a4b547ba7547a74b Mon Sep 17 00:00:00 2001 From: Irvine Sunday Date: Tue, 11 Aug 2020 19:19:36 +0300 Subject: [PATCH 07/14] Update ref test and test resource files --- .../PathItem/RefPathItemHandlerTests.cs | 2 +- .../Resources/Multiple.Schema.OpenApi.V2.json | 135 +-------- .../Resources/Multiple.Schema.OpenApi.V2.yaml | 99 +------ .../Resources/Multiple.Schema.OpenApi.json | 153 +--------- .../Resources/Multiple.Schema.OpenApi.yaml | 108 +------ .../Resources/TripService.OpenApi.V2.json | 236 +-------------- .../Resources/TripService.OpenApi.V2.yaml | 168 +---------- .../Resources/TripService.OpenApi.json | 268 +----------------- .../Resources/TripService.OpenApi.yaml | 184 +----------- 9 files changed, 73 insertions(+), 1280 deletions(-) diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/PathItem/RefPathItemHandlerTests.cs b/test/Microsoft.OpenAPI.OData.Reader.Tests/PathItem/RefPathItemHandlerTests.cs index d29e3954..ee055a43 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/PathItem/RefPathItemHandlerTests.cs +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/PathItem/RefPathItemHandlerTests.cs @@ -57,7 +57,7 @@ public void CreatePathItemThrowsForNonNavigationPropertyPath() } [Theory] - [InlineData(true, new OperationType[] { OperationType.Get, OperationType.Post, OperationType.Delete })] + [InlineData(true, new OperationType[] { OperationType.Get, OperationType.Post})] [InlineData(false, new OperationType[] { OperationType.Get, OperationType.Put, OperationType.Delete })] public void CreateNavigationPropertyRefPathItemReturnsCorrectPathItem(bool collectionNav, OperationType[] expected) { diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json index 12913238..d61f29a5 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json @@ -998,7 +998,7 @@ "description": "New navigation property ref value", "required": true, "schema": { - "type": "String" + "type": "object" } } ], @@ -1006,7 +1006,7 @@ "201": { "description": "Created navigation property link.", "schema": { - "type": "String" + "type": "object" } }, "default": { @@ -1014,47 +1014,6 @@ } }, "x-ms-docs-operation-type": "operation" - }, - "delete": { - "tags": [ - "Documents.RevisionDto" - ], - "summary": "Delete ref of navigation property Revisions for Documents", - "operationId": "Documents.DeleteRefRevisions", - "parameters": [ - { - "in": "path", - "name": "Id", - "description": "key: Id of DocumentDto", - "required": true, - "type": "integer", - "format": "int32", - "maximum": 2147483647, - "minimum": -2147483648, - "x-ms-docs-key-type": "DocumentDto" - }, - { - "in": "header", - "name": "If-Match", - "description": "ETag", - "type": "string" - }, - { - "in": "query", - "name": "@id", - "description": "Delete Uri", - "type": "string" - } - ], - "responses": { - "204": { - "description": "Success" - }, - "default": { - "$ref": "#/responses/error" - } - }, - "x-ms-docs-operation-type": "operation" } }, "/Libraries": { @@ -1707,7 +1666,7 @@ "description": "New navigation property ref value", "required": true, "schema": { - "type": "String" + "type": "object" } } ], @@ -1715,7 +1674,7 @@ "201": { "description": "Created navigation property link.", "schema": { - "type": "String" + "type": "object" } }, "default": { @@ -1723,47 +1682,6 @@ } }, "x-ms-docs-operation-type": "operation" - }, - "delete": { - "tags": [ - "Libraries.DocumentDto" - ], - "summary": "Delete ref of navigation property Documents for Libraries", - "operationId": "Libraries.DeleteRefDocuments", - "parameters": [ - { - "in": "path", - "name": "Id", - "description": "key: Id of LibraryDto", - "required": true, - "type": "integer", - "format": "int32", - "maximum": 2147483647, - "minimum": -2147483648, - "x-ms-docs-key-type": "LibraryDto" - }, - { - "in": "header", - "name": "If-Match", - "description": "ETag", - "type": "string" - }, - { - "in": "query", - "name": "@id", - "description": "Delete Uri", - "type": "string" - } - ], - "responses": { - "204": { - "description": "Success" - }, - "default": { - "$ref": "#/responses/error" - } - }, - "x-ms-docs-operation-type": "operation" } }, "/Revisions": { @@ -3031,7 +2949,7 @@ "description": "New navigation property ref value", "required": true, "schema": { - "type": "String" + "type": "object" } } ], @@ -3039,7 +2957,7 @@ "201": { "description": "Created navigation property link.", "schema": { - "type": "String" + "type": "object" } }, "default": { @@ -3047,47 +2965,6 @@ } }, "x-ms-docs-operation-type": "operation" - }, - "delete": { - "tags": [ - "Tasks.RevisionDto" - ], - "summary": "Delete ref of navigation property Revisions for Tasks", - "operationId": "Tasks.DeleteRefRevisions", - "parameters": [ - { - "in": "path", - "name": "Id", - "description": "key: Id of DocumentDto", - "required": true, - "type": "integer", - "format": "int32", - "maximum": 2147483647, - "minimum": -2147483648, - "x-ms-docs-key-type": "DocumentDto" - }, - { - "in": "header", - "name": "If-Match", - "description": "ETag", - "type": "string" - }, - { - "in": "query", - "name": "@id", - "description": "Delete Uri", - "type": "string" - } - ], - "responses": { - "204": { - "description": "Success" - }, - "default": { - "$ref": "#/responses/error" - } - }, - "x-ms-docs-operation-type": "operation" } } }, diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml index 20963d82..521d9799 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml @@ -720,41 +720,12 @@ paths: description: New navigation property ref value required: true schema: - type: String + type: object responses: '201': description: Created navigation property link. schema: - type: String - default: - $ref: '#/responses/error' - x-ms-docs-operation-type: operation - delete: - tags: - - Documents.RevisionDto - summary: Delete ref of navigation property Revisions for Documents - operationId: Documents.DeleteRefRevisions - parameters: - - in: path - name: Id - description: 'key: Id of DocumentDto' - required: true - type: integer - format: int32 - maximum: 2147483647 - minimum: -2147483648 - x-ms-docs-key-type: DocumentDto - - in: header - name: If-Match - description: ETag - type: string - - in: query - name: '@id' - description: Delete Uri - type: string - responses: - '204': - description: Success + type: object default: $ref: '#/responses/error' x-ms-docs-operation-type: operation @@ -1231,41 +1202,12 @@ paths: description: New navigation property ref value required: true schema: - type: String + type: object responses: '201': description: Created navigation property link. schema: - type: String - default: - $ref: '#/responses/error' - x-ms-docs-operation-type: operation - delete: - tags: - - Libraries.DocumentDto - summary: Delete ref of navigation property Documents for Libraries - operationId: Libraries.DeleteRefDocuments - parameters: - - in: path - name: Id - description: 'key: Id of LibraryDto' - required: true - type: integer - format: int32 - maximum: 2147483647 - minimum: -2147483648 - x-ms-docs-key-type: LibraryDto - - in: header - name: If-Match - description: ETag - type: string - - in: query - name: '@id' - description: Delete Uri - type: string - responses: - '204': - description: Success + type: object default: $ref: '#/responses/error' x-ms-docs-operation-type: operation @@ -2207,41 +2149,12 @@ paths: description: New navigation property ref value required: true schema: - type: String + type: object responses: '201': description: Created navigation property link. schema: - type: String - default: - $ref: '#/responses/error' - x-ms-docs-operation-type: operation - delete: - tags: - - Tasks.RevisionDto - summary: Delete ref of navigation property Revisions for Tasks - operationId: Tasks.DeleteRefRevisions - parameters: - - in: path - name: Id - description: 'key: Id of DocumentDto' - required: true - type: integer - format: int32 - maximum: 2147483647 - minimum: -2147483648 - x-ms-docs-key-type: DocumentDto - - in: header - name: If-Match - description: ETag - type: string - - in: query - name: '@id' - description: Delete Uri - type: string - responses: - '204': - description: Success + type: object default: $ref: '#/responses/error' x-ms-docs-operation-type: operation diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json index 0467b7b8..cef8c653 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json @@ -1120,7 +1120,7 @@ "content": { "application/json": { "schema": { - "type": "String" + "type": "object" } } }, @@ -1132,7 +1132,7 @@ "content": { "application/json": { "schema": { - "type": "String" + "type": "object" } } } @@ -1142,53 +1142,6 @@ } }, "x-ms-docs-operation-type": "operation" - }, - "delete": { - "tags": [ - "Documents.RevisionDto" - ], - "summary": "Delete ref of navigation property Revisions for Documents", - "operationId": "Documents.DeleteRefRevisions", - "parameters": [ - { - "name": "Id", - "in": "path", - "description": "key: Id of DocumentDto", - "required": true, - "schema": { - "maximum": 2147483647, - "minimum": -2147483648, - "type": "integer", - "format": "int32" - }, - "x-ms-docs-key-type": "DocumentDto" - }, - { - "name": "If-Match", - "in": "header", - "description": "ETag", - "schema": { - "type": "string" - } - }, - { - "name": "@id", - "in": "query", - "description": "Delete Uri", - "schema": { - "type": "string" - } - } - ], - "responses": { - "204": { - "description": "Success" - }, - "default": { - "$ref": "#/components/responses/error" - } - }, - "x-ms-docs-operation-type": "operation" } }, "/Libraries": { @@ -1927,7 +1880,7 @@ "content": { "application/json": { "schema": { - "type": "String" + "type": "object" } } }, @@ -1939,7 +1892,7 @@ "content": { "application/json": { "schema": { - "type": "String" + "type": "object" } } } @@ -1949,53 +1902,6 @@ } }, "x-ms-docs-operation-type": "operation" - }, - "delete": { - "tags": [ - "Libraries.DocumentDto" - ], - "summary": "Delete ref of navigation property Documents for Libraries", - "operationId": "Libraries.DeleteRefDocuments", - "parameters": [ - { - "name": "Id", - "in": "path", - "description": "key: Id of LibraryDto", - "required": true, - "schema": { - "maximum": 2147483647, - "minimum": -2147483648, - "type": "integer", - "format": "int32" - }, - "x-ms-docs-key-type": "LibraryDto" - }, - { - "name": "If-Match", - "in": "header", - "description": "ETag", - "schema": { - "type": "string" - } - }, - { - "name": "@id", - "in": "query", - "description": "Delete Uri", - "schema": { - "type": "string" - } - } - ], - "responses": { - "204": { - "description": "Success" - }, - "default": { - "$ref": "#/components/responses/error" - } - }, - "x-ms-docs-operation-type": "operation" } }, "/Revisions": { @@ -3477,7 +3383,7 @@ "content": { "application/json": { "schema": { - "type": "String" + "type": "object" } } }, @@ -3489,7 +3395,7 @@ "content": { "application/json": { "schema": { - "type": "String" + "type": "object" } } } @@ -3499,53 +3405,6 @@ } }, "x-ms-docs-operation-type": "operation" - }, - "delete": { - "tags": [ - "Tasks.RevisionDto" - ], - "summary": "Delete ref of navigation property Revisions for Tasks", - "operationId": "Tasks.DeleteRefRevisions", - "parameters": [ - { - "name": "Id", - "in": "path", - "description": "key: Id of DocumentDto", - "required": true, - "schema": { - "maximum": 2147483647, - "minimum": -2147483648, - "type": "integer", - "format": "int32" - }, - "x-ms-docs-key-type": "DocumentDto" - }, - { - "name": "If-Match", - "in": "header", - "description": "ETag", - "schema": { - "type": "string" - } - }, - { - "name": "@id", - "in": "query", - "description": "Delete Uri", - "schema": { - "type": "string" - } - } - ], - "responses": { - "204": { - "description": "Success" - }, - "default": { - "$ref": "#/components/responses/error" - } - }, - "x-ms-docs-operation-type": "operation" } } }, diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml index 6136e7be..90ec19f0 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml @@ -798,7 +798,7 @@ paths: content: application/json: schema: - type: String + type: object required: true responses: '201': @@ -806,39 +806,7 @@ paths: content: application/json: schema: - type: String - default: - $ref: '#/components/responses/error' - x-ms-docs-operation-type: operation - delete: - tags: - - Documents.RevisionDto - summary: Delete ref of navigation property Revisions for Documents - operationId: Documents.DeleteRefRevisions - parameters: - - name: Id - in: path - description: 'key: Id of DocumentDto' - required: true - schema: - maximum: 2147483647 - minimum: -2147483648 - type: integer - format: int32 - x-ms-docs-key-type: DocumentDto - - name: If-Match - in: header - description: ETag - schema: - type: string - - name: '@id' - in: query - description: Delete Uri - schema: - type: string - responses: - '204': - description: Success + type: object default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation @@ -1372,7 +1340,7 @@ paths: content: application/json: schema: - type: String + type: object required: true responses: '201': @@ -1380,39 +1348,7 @@ paths: content: application/json: schema: - type: String - default: - $ref: '#/components/responses/error' - x-ms-docs-operation-type: operation - delete: - tags: - - Libraries.DocumentDto - summary: Delete ref of navigation property Documents for Libraries - operationId: Libraries.DeleteRefDocuments - parameters: - - name: Id - in: path - description: 'key: Id of LibraryDto' - required: true - schema: - maximum: 2147483647 - minimum: -2147483648 - type: integer - format: int32 - x-ms-docs-key-type: LibraryDto - - name: If-Match - in: header - description: ETag - schema: - type: string - - name: '@id' - in: query - description: Delete Uri - schema: - type: string - responses: - '204': - description: Success + type: object default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation @@ -2492,7 +2428,7 @@ paths: content: application/json: schema: - type: String + type: object required: true responses: '201': @@ -2500,39 +2436,7 @@ paths: content: application/json: schema: - type: String - default: - $ref: '#/components/responses/error' - x-ms-docs-operation-type: operation - delete: - tags: - - Tasks.RevisionDto - summary: Delete ref of navigation property Revisions for Tasks - operationId: Tasks.DeleteRefRevisions - parameters: - - name: Id - in: path - description: 'key: Id of DocumentDto' - required: true - schema: - maximum: 2147483647 - minimum: -2147483648 - type: integer - format: int32 - x-ms-docs-key-type: DocumentDto - - name: If-Match - in: header - description: ETag - schema: - type: string - - name: '@id' - in: query - description: Delete Uri - schema: - type: string - responses: - '204': - description: Success + type: object default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json index 1a778246..8ff50391 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json @@ -1127,7 +1127,7 @@ "description": "New navigation property ref value", "required": true, "schema": { - "type": "String" + "type": "object" } } ], @@ -1135,7 +1135,7 @@ "201": { "description": "Created navigation property link.", "schema": { - "type": "String" + "type": "object" } }, "default": { @@ -1143,36 +1143,6 @@ } }, "x-ms-docs-operation-type": "operation" - }, - "delete": { - "tags": [ - "Me.Person" - ], - "summary": "Delete ref of navigation property Friends for Me", - "operationId": "Me.DeleteRefFriends", - "parameters": [ - { - "in": "header", - "name": "If-Match", - "description": "ETag", - "type": "string" - }, - { - "in": "query", - "name": "@id", - "description": "Delete Uri", - "type": "string" - } - ], - "responses": { - "204": { - "description": "Success" - }, - "default": { - "$ref": "#/responses/error" - } - }, - "x-ms-docs-operation-type": "operation" } }, "/Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFavoriteAirline()": { @@ -1677,7 +1647,7 @@ "description": "New navigation property ref value", "required": true, "schema": { - "type": "String" + "type": "object" } } ], @@ -1685,7 +1655,7 @@ "201": { "description": "Created navigation property link.", "schema": { - "type": "String" + "type": "object" } }, "default": { @@ -1693,36 +1663,6 @@ } }, "x-ms-docs-operation-type": "operation" - }, - "delete": { - "tags": [ - "Me.Trip" - ], - "summary": "Delete ref of navigation property Trips for Me", - "operationId": "Me.DeleteRefTrips", - "parameters": [ - { - "in": "header", - "name": "If-Match", - "description": "ETag", - "type": "string" - }, - { - "in": "query", - "name": "@id", - "description": "Delete Uri", - "type": "string" - } - ], - "responses": { - "204": { - "description": "Success" - }, - "default": { - "$ref": "#/responses/error" - } - }, - "x-ms-docs-operation-type": "operation" } }, "/NewComePeople": { @@ -2535,7 +2475,7 @@ "description": "New navigation property ref value", "required": true, "schema": { - "type": "String" + "type": "object" } } ], @@ -2543,7 +2483,7 @@ "201": { "description": "Created navigation property link.", "schema": { - "type": "String" + "type": "object" } }, "default": { @@ -2551,44 +2491,6 @@ } }, "x-ms-docs-operation-type": "operation" - }, - "delete": { - "tags": [ - "NewComePeople.Person" - ], - "summary": "Delete ref of navigation property Friends for NewComePeople", - "operationId": "NewComePeople.DeleteRefFriends", - "parameters": [ - { - "in": "path", - "name": "UserName", - "description": "key: UserName of Person", - "required": true, - "type": "string", - "x-ms-docs-key-type": "Person" - }, - { - "in": "header", - "name": "If-Match", - "description": "ETag", - "type": "string" - }, - { - "in": "query", - "name": "@id", - "description": "Delete Uri", - "type": "string" - } - ], - "responses": { - "204": { - "description": "Success" - }, - "default": { - "$ref": "#/responses/error" - } - }, - "x-ms-docs-operation-type": "operation" } }, "/NewComePeople/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFavoriteAirline()": { @@ -3175,7 +3077,7 @@ "description": "New navigation property ref value", "required": true, "schema": { - "type": "String" + "type": "object" } } ], @@ -3183,7 +3085,7 @@ "201": { "description": "Created navigation property link.", "schema": { - "type": "String" + "type": "object" } }, "default": { @@ -3191,44 +3093,6 @@ } }, "x-ms-docs-operation-type": "operation" - }, - "delete": { - "tags": [ - "NewComePeople.Trip" - ], - "summary": "Delete ref of navigation property Trips for NewComePeople", - "operationId": "NewComePeople.DeleteRefTrips", - "parameters": [ - { - "in": "path", - "name": "UserName", - "description": "key: UserName of Person", - "required": true, - "type": "string", - "x-ms-docs-key-type": "Person" - }, - { - "in": "header", - "name": "If-Match", - "description": "ETag", - "type": "string" - }, - { - "in": "query", - "name": "@id", - "description": "Delete Uri", - "type": "string" - } - ], - "responses": { - "204": { - "description": "Success" - }, - "default": { - "$ref": "#/responses/error" - } - }, - "x-ms-docs-operation-type": "operation" } }, "/People": { @@ -4041,7 +3905,7 @@ "description": "New navigation property ref value", "required": true, "schema": { - "type": "String" + "type": "object" } } ], @@ -4049,7 +3913,7 @@ "201": { "description": "Created navigation property link.", "schema": { - "type": "String" + "type": "object" } }, "default": { @@ -4057,44 +3921,6 @@ } }, "x-ms-docs-operation-type": "operation" - }, - "delete": { - "tags": [ - "People.Person" - ], - "summary": "Delete ref of navigation property Friends for People", - "operationId": "People.DeleteRefFriends", - "parameters": [ - { - "in": "path", - "name": "UserName", - "description": "key: UserName of Person", - "required": true, - "type": "string", - "x-ms-docs-key-type": "Person" - }, - { - "in": "header", - "name": "If-Match", - "description": "ETag", - "type": "string" - }, - { - "in": "query", - "name": "@id", - "description": "Delete Uri", - "type": "string" - } - ], - "responses": { - "204": { - "description": "Success" - }, - "default": { - "$ref": "#/responses/error" - } - }, - "x-ms-docs-operation-type": "operation" } }, "/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFavoriteAirline()": { @@ -4681,7 +4507,7 @@ "description": "New navigation property ref value", "required": true, "schema": { - "type": "String" + "type": "object" } } ], @@ -4689,7 +4515,7 @@ "201": { "description": "Created navigation property link.", "schema": { - "type": "String" + "type": "object" } }, "default": { @@ -4697,44 +4523,6 @@ } }, "x-ms-docs-operation-type": "operation" - }, - "delete": { - "tags": [ - "People.Trip" - ], - "summary": "Delete ref of navigation property Trips for People", - "operationId": "People.DeleteRefTrips", - "parameters": [ - { - "in": "path", - "name": "UserName", - "description": "key: UserName of Person", - "required": true, - "type": "string", - "x-ms-docs-key-type": "Person" - }, - { - "in": "header", - "name": "If-Match", - "description": "ETag", - "type": "string" - }, - { - "in": "query", - "name": "@id", - "description": "Delete Uri", - "type": "string" - } - ], - "responses": { - "204": { - "description": "Success" - }, - "default": { - "$ref": "#/responses/error" - } - }, - "x-ms-docs-operation-type": "operation" } }, "/ResetDataSource": { diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml index ac1b4ec2..fa7f0a61 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml @@ -777,32 +777,12 @@ paths: description: New navigation property ref value required: true schema: - type: String + type: object responses: '201': description: Created navigation property link. schema: - type: String - default: - $ref: '#/responses/error' - x-ms-docs-operation-type: operation - delete: - tags: - - Me.Person - summary: Delete ref of navigation property Friends for Me - operationId: Me.DeleteRefFriends - parameters: - - in: header - name: If-Match - description: ETag - type: string - - in: query - name: '@id' - description: Delete Uri - type: string - responses: - '204': - description: Success + type: object default: $ref: '#/responses/error' x-ms-docs-operation-type: operation @@ -1152,32 +1132,12 @@ paths: description: New navigation property ref value required: true schema: - type: String + type: object responses: '201': description: Created navigation property link. schema: - type: String - default: - $ref: '#/responses/error' - x-ms-docs-operation-type: operation - delete: - tags: - - Me.Trip - summary: Delete ref of navigation property Trips for Me - operationId: Me.DeleteRefTrips - parameters: - - in: header - name: If-Match - description: ETag - type: string - - in: query - name: '@id' - description: Delete Uri - type: string - responses: - '204': - description: Success + type: object default: $ref: '#/responses/error' x-ms-docs-operation-type: operation @@ -1762,38 +1722,12 @@ paths: description: New navigation property ref value required: true schema: - type: String + type: object responses: '201': description: Created navigation property link. schema: - type: String - default: - $ref: '#/responses/error' - x-ms-docs-operation-type: operation - delete: - tags: - - NewComePeople.Person - summary: Delete ref of navigation property Friends for NewComePeople - operationId: NewComePeople.DeleteRefFriends - parameters: - - in: path - name: UserName - description: 'key: UserName of Person' - required: true - type: string - x-ms-docs-key-type: Person - - in: header - name: If-Match - description: ETag - type: string - - in: query - name: '@id' - description: Delete Uri - type: string - responses: - '204': - description: Success + type: object default: $ref: '#/responses/error' x-ms-docs-operation-type: operation @@ -2204,38 +2138,12 @@ paths: description: New navigation property ref value required: true schema: - type: String + type: object responses: '201': description: Created navigation property link. schema: - type: String - default: - $ref: '#/responses/error' - x-ms-docs-operation-type: operation - delete: - tags: - - NewComePeople.Trip - summary: Delete ref of navigation property Trips for NewComePeople - operationId: NewComePeople.DeleteRefTrips - parameters: - - in: path - name: UserName - description: 'key: UserName of Person' - required: true - type: string - x-ms-docs-key-type: Person - - in: header - name: If-Match - description: ETag - type: string - - in: query - name: '@id' - description: Delete Uri - type: string - responses: - '204': - description: Success + type: object default: $ref: '#/responses/error' x-ms-docs-operation-type: operation @@ -2820,38 +2728,12 @@ paths: description: New navigation property ref value required: true schema: - type: String + type: object responses: '201': description: Created navigation property link. schema: - type: String - default: - $ref: '#/responses/error' - x-ms-docs-operation-type: operation - delete: - tags: - - People.Person - summary: Delete ref of navigation property Friends for People - operationId: People.DeleteRefFriends - parameters: - - in: path - name: UserName - description: 'key: UserName of Person' - required: true - type: string - x-ms-docs-key-type: Person - - in: header - name: If-Match - description: ETag - type: string - - in: query - name: '@id' - description: Delete Uri - type: string - responses: - '204': - description: Success + type: object default: $ref: '#/responses/error' x-ms-docs-operation-type: operation @@ -3262,38 +3144,12 @@ paths: description: New navigation property ref value required: true schema: - type: String + type: object responses: '201': description: Created navigation property link. schema: - type: String - default: - $ref: '#/responses/error' - x-ms-docs-operation-type: operation - delete: - tags: - - People.Trip - summary: Delete ref of navigation property Trips for People - operationId: People.DeleteRefTrips - parameters: - - in: path - name: UserName - description: 'key: UserName of Person' - required: true - type: string - x-ms-docs-key-type: Person - - in: header - name: If-Match - description: ETag - type: string - - in: query - name: '@id' - description: Delete Uri - type: string - responses: - '204': - description: Success + type: object default: $ref: '#/responses/error' x-ms-docs-operation-type: operation diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json index e1daa1e9..5ace8fea 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json @@ -1283,7 +1283,7 @@ "content": { "application/json": { "schema": { - "type": "String" + "type": "object" } } }, @@ -1295,7 +1295,7 @@ "content": { "application/json": { "schema": { - "type": "String" + "type": "object" } } } @@ -1305,40 +1305,6 @@ } }, "x-ms-docs-operation-type": "operation" - }, - "delete": { - "tags": [ - "Me.Person" - ], - "summary": "Delete ref of navigation property Friends for Me", - "operationId": "Me.DeleteRefFriends", - "parameters": [ - { - "name": "If-Match", - "in": "header", - "description": "ETag", - "schema": { - "type": "string" - } - }, - { - "name": "@id", - "in": "query", - "description": "Delete Uri", - "schema": { - "type": "string" - } - } - ], - "responses": { - "204": { - "description": "Success" - }, - "default": { - "$ref": "#/components/responses/error" - } - }, - "x-ms-docs-operation-type": "operation" } }, "/Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFavoriteAirline()": { @@ -1895,7 +1861,7 @@ "content": { "application/json": { "schema": { - "type": "String" + "type": "object" } } }, @@ -1907,7 +1873,7 @@ "content": { "application/json": { "schema": { - "type": "String" + "type": "object" } } } @@ -1917,40 +1883,6 @@ } }, "x-ms-docs-operation-type": "operation" - }, - "delete": { - "tags": [ - "Me.Trip" - ], - "summary": "Delete ref of navigation property Trips for Me", - "operationId": "Me.DeleteRefTrips", - "parameters": [ - { - "name": "If-Match", - "in": "header", - "description": "ETag", - "schema": { - "type": "string" - } - }, - { - "name": "@id", - "in": "query", - "description": "Delete Uri", - "schema": { - "type": "string" - } - } - ], - "responses": { - "204": { - "description": "Success" - }, - "default": { - "$ref": "#/components/responses/error" - } - }, - "x-ms-docs-operation-type": "operation" } }, "/NewComePeople": { @@ -2853,7 +2785,7 @@ "content": { "application/json": { "schema": { - "type": "String" + "type": "object" } } }, @@ -2865,7 +2797,7 @@ "content": { "application/json": { "schema": { - "type": "String" + "type": "object" } } } @@ -2875,50 +2807,6 @@ } }, "x-ms-docs-operation-type": "operation" - }, - "delete": { - "tags": [ - "NewComePeople.Person" - ], - "summary": "Delete ref of navigation property Friends for NewComePeople", - "operationId": "NewComePeople.DeleteRefFriends", - "parameters": [ - { - "name": "UserName", - "in": "path", - "description": "key: UserName of Person", - "required": true, - "schema": { - "type": "string" - }, - "x-ms-docs-key-type": "Person" - }, - { - "name": "If-Match", - "in": "header", - "description": "ETag", - "schema": { - "type": "string" - } - }, - { - "name": "@id", - "in": "query", - "description": "Delete Uri", - "schema": { - "type": "string" - } - } - ], - "responses": { - "204": { - "description": "Success" - }, - "default": { - "$ref": "#/components/responses/error" - } - }, - "x-ms-docs-operation-type": "operation" } }, "/NewComePeople/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFavoriteAirline()": { @@ -3583,7 +3471,7 @@ "content": { "application/json": { "schema": { - "type": "String" + "type": "object" } } }, @@ -3595,7 +3483,7 @@ "content": { "application/json": { "schema": { - "type": "String" + "type": "object" } } } @@ -3605,50 +3493,6 @@ } }, "x-ms-docs-operation-type": "operation" - }, - "delete": { - "tags": [ - "NewComePeople.Trip" - ], - "summary": "Delete ref of navigation property Trips for NewComePeople", - "operationId": "NewComePeople.DeleteRefTrips", - "parameters": [ - { - "name": "UserName", - "in": "path", - "description": "key: UserName of Person", - "required": true, - "schema": { - "type": "string" - }, - "x-ms-docs-key-type": "Person" - }, - { - "name": "If-Match", - "in": "header", - "description": "ETag", - "schema": { - "type": "string" - } - }, - { - "name": "@id", - "in": "query", - "description": "Delete Uri", - "schema": { - "type": "string" - } - } - ], - "responses": { - "204": { - "description": "Success" - }, - "default": { - "$ref": "#/components/responses/error" - } - }, - "x-ms-docs-operation-type": "operation" } }, "/People": { @@ -4551,7 +4395,7 @@ "content": { "application/json": { "schema": { - "type": "String" + "type": "object" } } }, @@ -4563,7 +4407,7 @@ "content": { "application/json": { "schema": { - "type": "String" + "type": "object" } } } @@ -4573,50 +4417,6 @@ } }, "x-ms-docs-operation-type": "operation" - }, - "delete": { - "tags": [ - "People.Person" - ], - "summary": "Delete ref of navigation property Friends for People", - "operationId": "People.DeleteRefFriends", - "parameters": [ - { - "name": "UserName", - "in": "path", - "description": "key: UserName of Person", - "required": true, - "schema": { - "type": "string" - }, - "x-ms-docs-key-type": "Person" - }, - { - "name": "If-Match", - "in": "header", - "description": "ETag", - "schema": { - "type": "string" - } - }, - { - "name": "@id", - "in": "query", - "description": "Delete Uri", - "schema": { - "type": "string" - } - } - ], - "responses": { - "204": { - "description": "Success" - }, - "default": { - "$ref": "#/components/responses/error" - } - }, - "x-ms-docs-operation-type": "operation" } }, "/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFavoriteAirline()": { @@ -5281,7 +5081,7 @@ "content": { "application/json": { "schema": { - "type": "String" + "type": "object" } } }, @@ -5293,7 +5093,7 @@ "content": { "application/json": { "schema": { - "type": "String" + "type": "object" } } } @@ -5303,50 +5103,6 @@ } }, "x-ms-docs-operation-type": "operation" - }, - "delete": { - "tags": [ - "People.Trip" - ], - "summary": "Delete ref of navigation property Trips for People", - "operationId": "People.DeleteRefTrips", - "parameters": [ - { - "name": "UserName", - "in": "path", - "description": "key: UserName of Person", - "required": true, - "schema": { - "type": "string" - }, - "x-ms-docs-key-type": "Person" - }, - { - "name": "If-Match", - "in": "header", - "description": "ETag", - "schema": { - "type": "string" - } - }, - { - "name": "@id", - "in": "query", - "description": "Delete Uri", - "schema": { - "type": "string" - } - } - ], - "responses": { - "204": { - "description": "Success" - }, - "default": { - "$ref": "#/components/responses/error" - } - }, - "x-ms-docs-operation-type": "operation" } }, "/ResetDataSource": { diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml index c036753a..4af27075 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml @@ -870,7 +870,7 @@ paths: content: application/json: schema: - type: String + type: object required: true responses: '201': @@ -878,29 +878,7 @@ paths: content: application/json: schema: - type: String - default: - $ref: '#/components/responses/error' - x-ms-docs-operation-type: operation - delete: - tags: - - Me.Person - summary: Delete ref of navigation property Friends for Me - operationId: Me.DeleteRefFriends - parameters: - - name: If-Match - in: header - description: ETag - schema: - type: string - - name: '@id' - in: query - description: Delete Uri - schema: - type: string - responses: - '204': - description: Success + type: object default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation @@ -1277,7 +1255,7 @@ paths: content: application/json: schema: - type: String + type: object required: true responses: '201': @@ -1285,29 +1263,7 @@ paths: content: application/json: schema: - type: String - default: - $ref: '#/components/responses/error' - x-ms-docs-operation-type: operation - delete: - tags: - - Me.Trip - summary: Delete ref of navigation property Trips for Me - operationId: Me.DeleteRefTrips - parameters: - - name: If-Match - in: header - description: ETag - schema: - type: string - - name: '@id' - in: query - description: Delete Uri - schema: - type: string - responses: - '204': - description: Success + type: object default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation @@ -1950,7 +1906,7 @@ paths: content: application/json: schema: - type: String + type: object required: true responses: '201': @@ -1958,36 +1914,7 @@ paths: content: application/json: schema: - type: String - default: - $ref: '#/components/responses/error' - x-ms-docs-operation-type: operation - delete: - tags: - - NewComePeople.Person - summary: Delete ref of navigation property Friends for NewComePeople - operationId: NewComePeople.DeleteRefFriends - parameters: - - name: UserName - in: path - description: 'key: UserName of Person' - required: true - schema: - type: string - x-ms-docs-key-type: Person - - name: If-Match - in: header - description: ETag - schema: - type: string - - name: '@id' - in: query - description: Delete Uri - schema: - type: string - responses: - '204': - description: Success + type: object default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation @@ -2438,7 +2365,7 @@ paths: content: application/json: schema: - type: String + type: object required: true responses: '201': @@ -2446,36 +2373,7 @@ paths: content: application/json: schema: - type: String - default: - $ref: '#/components/responses/error' - x-ms-docs-operation-type: operation - delete: - tags: - - NewComePeople.Trip - summary: Delete ref of navigation property Trips for NewComePeople - operationId: NewComePeople.DeleteRefTrips - parameters: - - name: UserName - in: path - description: 'key: UserName of Person' - required: true - schema: - type: string - x-ms-docs-key-type: Person - - name: If-Match - in: header - description: ETag - schema: - type: string - - name: '@id' - in: query - description: Delete Uri - schema: - type: string - responses: - '204': - description: Success + type: object default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation @@ -3118,7 +3016,7 @@ paths: content: application/json: schema: - type: String + type: object required: true responses: '201': @@ -3126,36 +3024,7 @@ paths: content: application/json: schema: - type: String - default: - $ref: '#/components/responses/error' - x-ms-docs-operation-type: operation - delete: - tags: - - People.Person - summary: Delete ref of navigation property Friends for People - operationId: People.DeleteRefFriends - parameters: - - name: UserName - in: path - description: 'key: UserName of Person' - required: true - schema: - type: string - x-ms-docs-key-type: Person - - name: If-Match - in: header - description: ETag - schema: - type: string - - name: '@id' - in: query - description: Delete Uri - schema: - type: string - responses: - '204': - description: Success + type: object default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation @@ -3606,7 +3475,7 @@ paths: content: application/json: schema: - type: String + type: object required: true responses: '201': @@ -3614,36 +3483,7 @@ paths: content: application/json: schema: - type: String - default: - $ref: '#/components/responses/error' - x-ms-docs-operation-type: operation - delete: - tags: - - People.Trip - summary: Delete ref of navigation property Trips for People - operationId: People.DeleteRefTrips - parameters: - - name: UserName - in: path - description: 'key: UserName of Person' - required: true - schema: - type: string - x-ms-docs-key-type: Person - - name: If-Match - in: header - description: ETag - schema: - type: string - - name: '@id' - in: query - description: Delete Uri - schema: - type: string - responses: - '204': - description: Success + type: object default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation From 8caf2ff10a2c040479c2eb1f2c6b957e11baed7b Mon Sep 17 00:00:00 2001 From: Irvine Sunday <40403681+irvinesunday@users.noreply.github.com> Date: Tue, 11 Aug 2020 19:24:42 +0300 Subject: [PATCH 08/14] typo fix Co-authored-by: DeVere Dyett --- .../Operation/OperationHandlerProvider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/OperationHandlerProvider.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/OperationHandlerProvider.cs index 0737c13b..763f84a8 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Operation/OperationHandlerProvider.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Operation/OperationHandlerProvider.cs @@ -68,7 +68,7 @@ public OperationHandlerProvider() {OperationType.Delete, new NavigationPropertyDeleteOperationHandler() } }; - // navigati0n property ref (Get/Post/Put/Delete) + // navigation property ref (Get/Post/Put/Delete) _handlers[ODataPathKind.Ref] = new Dictionary { {OperationType.Get, new RefGetOperationHandler() }, From 8613a8e211b88e73c7c893891d80e7ae49738bea Mon Sep 17 00:00:00 2001 From: Irvine Sunday Date: Tue, 11 Aug 2020 21:05:34 +0300 Subject: [PATCH 09/14] Update test files with additionalProperties object --- .../Operation/RefPostOperationHandler.cs | 3 +- .../Operation/RefPutOperationHandler.cs | 3 +- .../Resources/Multiple.Schema.OpenApi.V2.json | 20 +++++++-- .../Resources/Multiple.Schema.OpenApi.V2.yaml | 8 ++++ .../Resources/Multiple.Schema.OpenApi.json | 20 +++++++-- .../Resources/Multiple.Schema.OpenApi.yaml | 8 ++++ .../Resources/TripService.OpenApi.V2.json | 45 +++++++++++++++---- .../Resources/TripService.OpenApi.V2.yaml | 18 ++++++++ .../Resources/TripService.OpenApi.json | 45 +++++++++++++++---- .../Resources/TripService.OpenApi.yaml | 18 ++++++++ 10 files changed, 160 insertions(+), 28 deletions(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/RefPostOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/RefPostOperationHandler.cs index 72b52836..e7b29ca6 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Operation/RefPostOperationHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Operation/RefPostOperationHandler.cs @@ -40,7 +40,8 @@ protected override void SetRequestBody(OpenApiOperation operation) { OpenApiSchema schema = new OpenApiSchema { - Type = "object" + Type = "object", + AdditionalProperties = new OpenApiSchema { Type = "object" } }; operation.RequestBody = new OpenApiRequestBody diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/RefPutOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/RefPutOperationHandler.cs index 5dc0ac44..0a97ca6f 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Operation/RefPutOperationHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Operation/RefPutOperationHandler.cs @@ -40,7 +40,8 @@ protected override void SetRequestBody(OpenApiOperation operation) { OpenApiSchema schema = new OpenApiSchema { - Type = "object" + Type = "object", + AdditionalProperties = new OpenApiSchema { Type = "object" } }; operation.RequestBody = new OpenApiRequestBody diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json index d61f29a5..0ce89148 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json @@ -998,7 +998,10 @@ "description": "New navigation property ref value", "required": true, "schema": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "object" + } } } ], @@ -1666,7 +1669,10 @@ "description": "New navigation property ref value", "required": true, "schema": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "object" + } } } ], @@ -2190,7 +2196,10 @@ "description": "New navigation property ref values", "required": true, "schema": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "object" + } } } ], @@ -2949,7 +2958,10 @@ "description": "New navigation property ref value", "required": true, "schema": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "object" + } } } ], diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml index 521d9799..0c6f7654 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml @@ -721,6 +721,8 @@ paths: required: true schema: type: object + additionalProperties: + type: object responses: '201': description: Created navigation property link. @@ -1203,6 +1205,8 @@ paths: required: true schema: type: object + additionalProperties: + type: object responses: '201': description: Created navigation property link. @@ -1597,6 +1601,8 @@ paths: required: true schema: type: object + additionalProperties: + type: object responses: '204': description: Success @@ -2150,6 +2156,8 @@ paths: required: true schema: type: object + additionalProperties: + type: object responses: '201': description: Created navigation property link. diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json index cef8c653..055c92df 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json @@ -1120,7 +1120,10 @@ "content": { "application/json": { "schema": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "object" + } } } }, @@ -1880,7 +1883,10 @@ "content": { "application/json": { "schema": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "object" + } } } }, @@ -2529,7 +2535,10 @@ "content": { "application/json": { "schema": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "object" + } } } }, @@ -3383,7 +3392,10 @@ "content": { "application/json": { "schema": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "object" + } } } }, diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml index 90ec19f0..feeaf017 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml @@ -799,6 +799,8 @@ paths: application/json: schema: type: object + additionalProperties: + type: object required: true responses: '201': @@ -1341,6 +1343,8 @@ paths: application/json: schema: type: object + additionalProperties: + type: object required: true responses: '201': @@ -1815,6 +1819,8 @@ paths: application/json: schema: type: object + additionalProperties: + type: object required: true responses: '204': @@ -2429,6 +2435,8 @@ paths: application/json: schema: type: object + additionalProperties: + type: object required: true responses: '201': diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json index 8ff50391..c26fef34 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json @@ -790,7 +790,10 @@ "description": "New navigation property ref values", "required": true, "schema": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "object" + } } } ], @@ -1127,7 +1130,10 @@ "description": "New navigation property ref value", "required": true, "schema": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "object" + } } } ], @@ -1647,7 +1653,10 @@ "description": "New navigation property ref value", "required": true, "schema": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "object" + } } } ], @@ -2098,7 +2107,10 @@ "description": "New navigation property ref values", "required": true, "schema": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "object" + } } } ], @@ -2475,7 +2487,10 @@ "description": "New navigation property ref value", "required": true, "schema": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "object" + } } } ], @@ -3077,7 +3092,10 @@ "description": "New navigation property ref value", "required": true, "schema": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "object" + } } } ], @@ -3528,7 +3546,10 @@ "description": "New navigation property ref values", "required": true, "schema": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "object" + } } } ], @@ -3905,7 +3926,10 @@ "description": "New navigation property ref value", "required": true, "schema": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "object" + } } } ], @@ -4507,7 +4531,10 @@ "description": "New navigation property ref value", "required": true, "schema": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "object" + } } } ], diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml index fa7f0a61..ef6a7284 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml @@ -539,6 +539,8 @@ paths: required: true schema: type: object + additionalProperties: + type: object responses: '204': description: Success @@ -778,6 +780,8 @@ paths: required: true schema: type: object + additionalProperties: + type: object responses: '201': description: Created navigation property link. @@ -1133,6 +1137,8 @@ paths: required: true schema: type: object + additionalProperties: + type: object responses: '201': description: Created navigation property link. @@ -1454,6 +1460,8 @@ paths: required: true schema: type: object + additionalProperties: + type: object responses: '204': description: Success @@ -1723,6 +1731,8 @@ paths: required: true schema: type: object + additionalProperties: + type: object responses: '201': description: Created navigation property link. @@ -2139,6 +2149,8 @@ paths: required: true schema: type: object + additionalProperties: + type: object responses: '201': description: Created navigation property link. @@ -2460,6 +2472,8 @@ paths: required: true schema: type: object + additionalProperties: + type: object responses: '204': description: Success @@ -2729,6 +2743,8 @@ paths: required: true schema: type: object + additionalProperties: + type: object responses: '201': description: Created navigation property link. @@ -3145,6 +3161,8 @@ paths: required: true schema: type: object + additionalProperties: + type: object responses: '201': description: Created navigation property link. diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json index 5ace8fea..4928e181 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json @@ -915,7 +915,10 @@ "content": { "application/json": { "schema": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "object" + } } } }, @@ -1283,7 +1286,10 @@ "content": { "application/json": { "schema": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "object" + } } } }, @@ -1861,7 +1867,10 @@ "content": { "application/json": { "schema": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "object" + } } } }, @@ -2365,7 +2374,10 @@ "content": { "application/json": { "schema": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "object" + } } } }, @@ -2785,7 +2797,10 @@ "content": { "application/json": { "schema": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "object" + } } } }, @@ -3471,7 +3486,10 @@ "content": { "application/json": { "schema": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "object" + } } } }, @@ -3975,7 +3993,10 @@ "content": { "application/json": { "schema": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "object" + } } } }, @@ -4395,7 +4416,10 @@ "content": { "application/json": { "schema": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "object" + } } } }, @@ -5081,7 +5105,10 @@ "content": { "application/json": { "schema": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "object" + } } } }, diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml index 4af27075..4108eb61 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml @@ -610,6 +610,8 @@ paths: application/json: schema: type: object + additionalProperties: + type: object required: true responses: '204': @@ -871,6 +873,8 @@ paths: application/json: schema: type: object + additionalProperties: + type: object required: true responses: '201': @@ -1256,6 +1260,8 @@ paths: application/json: schema: type: object + additionalProperties: + type: object required: true responses: '201': @@ -1610,6 +1616,8 @@ paths: application/json: schema: type: object + additionalProperties: + type: object required: true responses: '204': @@ -1907,6 +1915,8 @@ paths: application/json: schema: type: object + additionalProperties: + type: object required: true responses: '201': @@ -2366,6 +2376,8 @@ paths: application/json: schema: type: object + additionalProperties: + type: object required: true responses: '201': @@ -2720,6 +2732,8 @@ paths: application/json: schema: type: object + additionalProperties: + type: object required: true responses: '204': @@ -3017,6 +3031,8 @@ paths: application/json: schema: type: object + additionalProperties: + type: object required: true responses: '201': @@ -3476,6 +3492,8 @@ paths: application/json: schema: type: object + additionalProperties: + type: object required: true responses: '201': From 29659bdb13647ee07c06fe66140374d14c21ba48 Mon Sep 17 00:00:00 2001 From: Irvine Sunday <40403681+irvinesunday@users.noreply.github.com> Date: Tue, 11 Aug 2020 21:13:53 +0300 Subject: [PATCH 10/14] Add additionalProperties property to response schema Co-authored-by: Peter Ombwa --- .../Operation/RefPostOperationHandler.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/RefPostOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/RefPostOperationHandler.cs index e7b29ca6..67c4b6ec 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Operation/RefPostOperationHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Operation/RefPostOperationHandler.cs @@ -67,7 +67,8 @@ protected override void SetResponses(OpenApiOperation operation) { OpenApiSchema schema = new OpenApiSchema { - Type = "object" // What to return? + Type = "object", + AdditionalProperties = new OpenApiSchema { Type = "object" } }; operation.Responses = new OpenApiResponses From ff5b6d981b8be5b1c8d08db48a5375e348c59d85 Mon Sep 17 00:00:00 2001 From: Irvine Sunday Date: Tue, 11 Aug 2020 21:27:01 +0300 Subject: [PATCH 11/14] Update test files with additionalProperties object in response schema --- .../Resources/Multiple.Schema.OpenApi.V2.json | 15 ++++++++-- .../Resources/Multiple.Schema.OpenApi.V2.yaml | 6 ++++ .../Resources/Multiple.Schema.OpenApi.json | 15 ++++++++-- .../Resources/Multiple.Schema.OpenApi.yaml | 6 ++++ .../Resources/TripService.OpenApi.V2.json | 30 +++++++++++++++---- .../Resources/TripService.OpenApi.V2.yaml | 12 ++++++++ .../Resources/TripService.OpenApi.json | 30 +++++++++++++++---- .../Resources/TripService.OpenApi.yaml | 12 ++++++++ 8 files changed, 108 insertions(+), 18 deletions(-) diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json index 0ce89148..cb2f5c7d 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json @@ -1009,7 +1009,10 @@ "201": { "description": "Created navigation property link.", "schema": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "object" + } } }, "default": { @@ -1680,7 +1683,10 @@ "201": { "description": "Created navigation property link.", "schema": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "object" + } } }, "default": { @@ -2969,7 +2975,10 @@ "201": { "description": "Created navigation property link.", "schema": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "object" + } } }, "default": { diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml index 0c6f7654..b704e70b 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml @@ -728,6 +728,8 @@ paths: description: Created navigation property link. schema: type: object + additionalProperties: + type: object default: $ref: '#/responses/error' x-ms-docs-operation-type: operation @@ -1212,6 +1214,8 @@ paths: description: Created navigation property link. schema: type: object + additionalProperties: + type: object default: $ref: '#/responses/error' x-ms-docs-operation-type: operation @@ -2163,6 +2167,8 @@ paths: description: Created navigation property link. schema: type: object + additionalProperties: + type: object default: $ref: '#/responses/error' x-ms-docs-operation-type: operation diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json index 055c92df..c5917fcb 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json @@ -1135,7 +1135,10 @@ "content": { "application/json": { "schema": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "object" + } } } } @@ -1898,7 +1901,10 @@ "content": { "application/json": { "schema": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "object" + } } } } @@ -3407,7 +3413,10 @@ "content": { "application/json": { "schema": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "object" + } } } } diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml index feeaf017..ffd9b02e 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml @@ -809,6 +809,8 @@ paths: application/json: schema: type: object + additionalProperties: + type: object default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation @@ -1353,6 +1355,8 @@ paths: application/json: schema: type: object + additionalProperties: + type: object default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation @@ -2445,6 +2449,8 @@ paths: application/json: schema: type: object + additionalProperties: + type: object default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json index c26fef34..748f7f26 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json @@ -1141,7 +1141,10 @@ "201": { "description": "Created navigation property link.", "schema": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "object" + } } }, "default": { @@ -1664,7 +1667,10 @@ "201": { "description": "Created navigation property link.", "schema": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "object" + } } }, "default": { @@ -2498,7 +2504,10 @@ "201": { "description": "Created navigation property link.", "schema": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "object" + } } }, "default": { @@ -3103,7 +3112,10 @@ "201": { "description": "Created navigation property link.", "schema": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "object" + } } }, "default": { @@ -3937,7 +3949,10 @@ "201": { "description": "Created navigation property link.", "schema": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "object" + } } }, "default": { @@ -4542,7 +4557,10 @@ "201": { "description": "Created navigation property link.", "schema": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "object" + } } }, "default": { diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml index ef6a7284..49339610 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml @@ -787,6 +787,8 @@ paths: description: Created navigation property link. schema: type: object + additionalProperties: + type: object default: $ref: '#/responses/error' x-ms-docs-operation-type: operation @@ -1144,6 +1146,8 @@ paths: description: Created navigation property link. schema: type: object + additionalProperties: + type: object default: $ref: '#/responses/error' x-ms-docs-operation-type: operation @@ -1738,6 +1742,8 @@ paths: description: Created navigation property link. schema: type: object + additionalProperties: + type: object default: $ref: '#/responses/error' x-ms-docs-operation-type: operation @@ -2156,6 +2162,8 @@ paths: description: Created navigation property link. schema: type: object + additionalProperties: + type: object default: $ref: '#/responses/error' x-ms-docs-operation-type: operation @@ -2750,6 +2758,8 @@ paths: description: Created navigation property link. schema: type: object + additionalProperties: + type: object default: $ref: '#/responses/error' x-ms-docs-operation-type: operation @@ -3168,6 +3178,8 @@ paths: description: Created navigation property link. schema: type: object + additionalProperties: + type: object default: $ref: '#/responses/error' x-ms-docs-operation-type: operation diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json index 4928e181..1de3bdec 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json @@ -1301,7 +1301,10 @@ "content": { "application/json": { "schema": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "object" + } } } } @@ -1882,7 +1885,10 @@ "content": { "application/json": { "schema": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "object" + } } } } @@ -2812,7 +2818,10 @@ "content": { "application/json": { "schema": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "object" + } } } } @@ -3501,7 +3510,10 @@ "content": { "application/json": { "schema": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "object" + } } } } @@ -4431,7 +4443,10 @@ "content": { "application/json": { "schema": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "object" + } } } } @@ -5120,7 +5135,10 @@ "content": { "application/json": { "schema": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "object" + } } } } diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml index 4108eb61..322237f3 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml @@ -883,6 +883,8 @@ paths: application/json: schema: type: object + additionalProperties: + type: object default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation @@ -1270,6 +1272,8 @@ paths: application/json: schema: type: object + additionalProperties: + type: object default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation @@ -1925,6 +1929,8 @@ paths: application/json: schema: type: object + additionalProperties: + type: object default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation @@ -2386,6 +2392,8 @@ paths: application/json: schema: type: object + additionalProperties: + type: object default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation @@ -3041,6 +3049,8 @@ paths: application/json: schema: type: object + additionalProperties: + type: object default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation @@ -3502,6 +3512,8 @@ paths: application/json: schema: type: object + additionalProperties: + type: object default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation From d8404ea68306c0e451b68e74a3d845da80d02a1d Mon Sep 17 00:00:00 2001 From: Irvine Sunday <40403681+irvinesunday@users.noreply.github.com> Date: Tue, 11 Aug 2020 21:50:06 +0300 Subject: [PATCH 12/14] Revert return type for response schema Co-authored-by: Peter Ombwa --- .../Operation/RefPostOperationHandler.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/RefPostOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/RefPostOperationHandler.cs index 67c4b6ec..f2111b2f 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Operation/RefPostOperationHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Operation/RefPostOperationHandler.cs @@ -67,8 +67,7 @@ protected override void SetResponses(OpenApiOperation operation) { OpenApiSchema schema = new OpenApiSchema { - Type = "object", - AdditionalProperties = new OpenApiSchema { Type = "object" } + Type = "string" }; operation.Responses = new OpenApiResponses From 69776c8eab1e26286e6f37a69af177e290b35828 Mon Sep 17 00:00:00 2001 From: Irvine Sunday Date: Tue, 11 Aug 2020 22:15:44 +0300 Subject: [PATCH 13/14] Revert response schema type to object --- .../Operation/RefPostOperationHandler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/RefPostOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/RefPostOperationHandler.cs index f2111b2f..ede32705 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Operation/RefPostOperationHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Operation/RefPostOperationHandler.cs @@ -67,7 +67,7 @@ protected override void SetResponses(OpenApiOperation operation) { OpenApiSchema schema = new OpenApiSchema { - Type = "string" + Type = "object" }; operation.Responses = new OpenApiResponses From c2709c7896b2673646a40b4aa5d066c92427a8fd Mon Sep 17 00:00:00 2001 From: Irvine Sunday Date: Tue, 11 Aug 2020 22:16:37 +0300 Subject: [PATCH 14/14] Revert test files response schema; remove additionalProperties property --- .../Resources/Multiple.Schema.OpenApi.V2.json | 15 ++-------- .../Resources/Multiple.Schema.OpenApi.V2.yaml | 6 ---- .../Resources/Multiple.Schema.OpenApi.json | 15 ++-------- .../Resources/Multiple.Schema.OpenApi.yaml | 6 ---- .../Resources/TripService.OpenApi.V2.json | 30 ++++--------------- .../Resources/TripService.OpenApi.V2.yaml | 12 -------- .../Resources/TripService.OpenApi.json | 30 ++++--------------- .../Resources/TripService.OpenApi.yaml | 12 -------- 8 files changed, 18 insertions(+), 108 deletions(-) diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json index cb2f5c7d..0ce89148 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json @@ -1009,10 +1009,7 @@ "201": { "description": "Created navigation property link.", "schema": { - "type": "object", - "additionalProperties": { - "type": "object" - } + "type": "object" } }, "default": { @@ -1683,10 +1680,7 @@ "201": { "description": "Created navigation property link.", "schema": { - "type": "object", - "additionalProperties": { - "type": "object" - } + "type": "object" } }, "default": { @@ -2975,10 +2969,7 @@ "201": { "description": "Created navigation property link.", "schema": { - "type": "object", - "additionalProperties": { - "type": "object" - } + "type": "object" } }, "default": { diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml index b704e70b..0c6f7654 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml @@ -728,8 +728,6 @@ paths: description: Created navigation property link. schema: type: object - additionalProperties: - type: object default: $ref: '#/responses/error' x-ms-docs-operation-type: operation @@ -1214,8 +1212,6 @@ paths: description: Created navigation property link. schema: type: object - additionalProperties: - type: object default: $ref: '#/responses/error' x-ms-docs-operation-type: operation @@ -2167,8 +2163,6 @@ paths: description: Created navigation property link. schema: type: object - additionalProperties: - type: object default: $ref: '#/responses/error' x-ms-docs-operation-type: operation diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json index c5917fcb..055c92df 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json @@ -1135,10 +1135,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "additionalProperties": { - "type": "object" - } + "type": "object" } } } @@ -1901,10 +1898,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "additionalProperties": { - "type": "object" - } + "type": "object" } } } @@ -3413,10 +3407,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "additionalProperties": { - "type": "object" - } + "type": "object" } } } diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml index ffd9b02e..feeaf017 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml @@ -809,8 +809,6 @@ paths: application/json: schema: type: object - additionalProperties: - type: object default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation @@ -1355,8 +1353,6 @@ paths: application/json: schema: type: object - additionalProperties: - type: object default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation @@ -2449,8 +2445,6 @@ paths: application/json: schema: type: object - additionalProperties: - type: object default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json index 748f7f26..c26fef34 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json @@ -1141,10 +1141,7 @@ "201": { "description": "Created navigation property link.", "schema": { - "type": "object", - "additionalProperties": { - "type": "object" - } + "type": "object" } }, "default": { @@ -1667,10 +1664,7 @@ "201": { "description": "Created navigation property link.", "schema": { - "type": "object", - "additionalProperties": { - "type": "object" - } + "type": "object" } }, "default": { @@ -2504,10 +2498,7 @@ "201": { "description": "Created navigation property link.", "schema": { - "type": "object", - "additionalProperties": { - "type": "object" - } + "type": "object" } }, "default": { @@ -3112,10 +3103,7 @@ "201": { "description": "Created navigation property link.", "schema": { - "type": "object", - "additionalProperties": { - "type": "object" - } + "type": "object" } }, "default": { @@ -3949,10 +3937,7 @@ "201": { "description": "Created navigation property link.", "schema": { - "type": "object", - "additionalProperties": { - "type": "object" - } + "type": "object" } }, "default": { @@ -4557,10 +4542,7 @@ "201": { "description": "Created navigation property link.", "schema": { - "type": "object", - "additionalProperties": { - "type": "object" - } + "type": "object" } }, "default": { diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml index 49339610..ef6a7284 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml @@ -787,8 +787,6 @@ paths: description: Created navigation property link. schema: type: object - additionalProperties: - type: object default: $ref: '#/responses/error' x-ms-docs-operation-type: operation @@ -1146,8 +1144,6 @@ paths: description: Created navigation property link. schema: type: object - additionalProperties: - type: object default: $ref: '#/responses/error' x-ms-docs-operation-type: operation @@ -1742,8 +1738,6 @@ paths: description: Created navigation property link. schema: type: object - additionalProperties: - type: object default: $ref: '#/responses/error' x-ms-docs-operation-type: operation @@ -2162,8 +2156,6 @@ paths: description: Created navigation property link. schema: type: object - additionalProperties: - type: object default: $ref: '#/responses/error' x-ms-docs-operation-type: operation @@ -2758,8 +2750,6 @@ paths: description: Created navigation property link. schema: type: object - additionalProperties: - type: object default: $ref: '#/responses/error' x-ms-docs-operation-type: operation @@ -3178,8 +3168,6 @@ paths: description: Created navigation property link. schema: type: object - additionalProperties: - type: object default: $ref: '#/responses/error' x-ms-docs-operation-type: operation diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json index 1de3bdec..4928e181 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json @@ -1301,10 +1301,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "additionalProperties": { - "type": "object" - } + "type": "object" } } } @@ -1885,10 +1882,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "additionalProperties": { - "type": "object" - } + "type": "object" } } } @@ -2818,10 +2812,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "additionalProperties": { - "type": "object" - } + "type": "object" } } } @@ -3510,10 +3501,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "additionalProperties": { - "type": "object" - } + "type": "object" } } } @@ -4443,10 +4431,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "additionalProperties": { - "type": "object" - } + "type": "object" } } } @@ -5135,10 +5120,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "additionalProperties": { - "type": "object" - } + "type": "object" } } } diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml index 322237f3..4108eb61 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml @@ -883,8 +883,6 @@ paths: application/json: schema: type: object - additionalProperties: - type: object default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation @@ -1272,8 +1270,6 @@ paths: application/json: schema: type: object - additionalProperties: - type: object default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation @@ -1929,8 +1925,6 @@ paths: application/json: schema: type: object - additionalProperties: - type: object default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation @@ -2392,8 +2386,6 @@ paths: application/json: schema: type: object - additionalProperties: - type: object default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation @@ -3049,8 +3041,6 @@ paths: application/json: schema: type: object - additionalProperties: - type: object default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation @@ -3512,8 +3502,6 @@ paths: application/json: schema: type: object - additionalProperties: - type: object default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation