diff --git a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj b/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj index 998c1ba3..a0fdbac6 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj +++ b/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj @@ -15,13 +15,14 @@ netstandard2.0 Microsoft.OpenApi.OData true - 1.6.0-preview.1 + 1.6.0-preview.2 This package contains the codes you need to convert OData CSDL to Open API Document of Model. © Microsoft Corporation. All rights reserved. Microsoft OpenApi OData EDM https://github.com/Microsoft/OpenAPI.NET.OData - Reads annotations on structural properties of stream types for media entity paths #399 +- Updates the format of the request body schema of a collection of complex property #423 Microsoft.OpenApi.OData.Reader ..\..\tool\Microsoft.OpenApi.OData.snk diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/ComplexPropertyUpdateOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/ComplexPropertyUpdateOperationHandler.cs index 1d08caac..77420131 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Operation/ComplexPropertyUpdateOperationHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Operation/ComplexPropertyUpdateOperationHandler.cs @@ -98,29 +98,37 @@ protected override void AppendCustomParameters(OpenApiOperation operation) private OpenApiSchema GetOpenApiSchema() { - return ComplexPropertySegment.Property.Type.IsCollection() ? - new OpenApiSchema - { - Type = "array", - Items = new OpenApiSchema - { - UnresolvedReference = true, - Reference = new OpenApiReference - { - Type = ReferenceType.Schema, - Id = ComplexPropertySegment.ComplexType.FullName() - } - } - } - : - new OpenApiSchema + var schema = new OpenApiSchema + { + UnresolvedReference = true, + Reference = new OpenApiReference + { + Type = ReferenceType.Schema, + Id = ComplexPropertySegment.ComplexType.FullName() + } + }; + + if (ComplexPropertySegment.Property.Type.IsCollection()) + { + return new OpenApiSchema { - UnresolvedReference = true, - Reference = new OpenApiReference - { - Type = ReferenceType.Schema, - Id = ComplexPropertySegment.ComplexType.FullName() + Type = Constants.ObjectType, + Properties = new Dictionary + { + { + "value", + new OpenApiSchema + { + Type = "array", + Items = schema + } + } } - }; + }; + } + else + { + return schema; + } } } \ No newline at end of file diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/ComplexPropertyGetOperationHandlerTests.cs b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/ComplexPropertyGetOperationHandlerTests.cs index df773250..27fe7a9e 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/ComplexPropertyGetOperationHandlerTests.cs +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/ComplexPropertyGetOperationHandlerTests.cs @@ -80,8 +80,8 @@ public void CreateComplexPropertyGetOperationReturnsCorrectOperationForCollectio // Assert Assert.NotNull(get); - Assert.Equal("Get AlternativeAddresses property value", get.Summary); - Assert.Equal("The AlternativeAddresses.", get.Description); + Assert.Equal("Get the AlternativeAddresses.", get.Summary); + Assert.Equal("Get the AlternativeAddresses value.", get.Description); Assert.NotNull(get.Parameters); Assert.Equal(9, get.Parameters.Count); //id, select, expand, order, top, skip, count, search, filter diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/ComplexPropertyPutOperationHandlerTests.cs b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/ComplexPropertyPutOperationHandlerTests.cs index bf02b4f9..007b362f 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/ComplexPropertyPutOperationHandlerTests.cs +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/ComplexPropertyPutOperationHandlerTests.cs @@ -3,7 +3,6 @@ // Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. // ------------------------------------------------------------ -using System; using System.Linq; using Microsoft.OData.Edm; using Microsoft.OpenApi.OData.Edm; @@ -78,7 +77,7 @@ public void CreateComplexPropertyPutOperationReturnsCorrectOperationForCollectio var model = EntitySetGetOperationHandlerTests.GetEdmModel(""); var entitySet = model.EntityContainer.FindEntitySet("Customers"); var entity = entitySet.EntityType(); - var property = entity.FindProperty("BillingAddress"); + var property = entity.FindProperty("AlternativeAddresses"); var settings = new OpenApiConvertSettings { EnableOperationId = enableOperationId @@ -91,8 +90,8 @@ public void CreateComplexPropertyPutOperationReturnsCorrectOperationForCollectio // Assert Assert.NotNull(put); - Assert.Equal("Update the BillingAddress.", put.Summary); - Assert.Equal("Update the BillingAddress value.", put.Description); + Assert.Equal("Update the AlternativeAddresses.", put.Summary); + Assert.Equal("Update the AlternativeAddresses value.", put.Description); Assert.NotNull(put.Parameters); Assert.Single(put.Parameters); //id @@ -100,10 +99,16 @@ public void CreateComplexPropertyPutOperationReturnsCorrectOperationForCollectio Assert.NotNull(put.Responses); Assert.Equal(2, put.Responses.Count); Assert.Equal(new[] { "204", "default" }, put.Responses.Select(r => r.Key)); - - if (enableOperationId) + var schema = put.RequestBody?.Content.FirstOrDefault().Value?.Schema; + + Assert.NotNull(schema); + Assert.Equal("object", schema.Type); + Assert.Equal("value", schema.Properties.FirstOrDefault().Key); + Assert.Equal("array", schema.Properties.FirstOrDefault().Value.Type); + + if (enableOperationId) { - Assert.Equal("Customers.UpdateBillingAddress", put.OperationId); + Assert.Equal("Customers.UpdateAlternativeAddresses", put.OperationId); } else { diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EntitySetGetOperationHandlerTests.cs b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EntitySetGetOperationHandlerTests.cs index ea35ff07..74e270fe 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EntitySetGetOperationHandlerTests.cs +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EntitySetGetOperationHandlerTests.cs @@ -356,8 +356,18 @@ public static IEdmModel GetEdmModel(string annotation) - - + + + + + + + + + + + + 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 b636b2a2..b19a6238 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 @@ -1078,9 +1078,14 @@ "description": "New property values", "required": true, "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Siterra.Documents.App.DTO.DocumentTagRelDto" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Siterra.Documents.App.DTO.DocumentTagRelDto" + } + } } } } @@ -1811,9 +1816,14 @@ "description": "New property values", "required": true, "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Siterra.Documents.App.DTO.DocumentTagRelDto" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Siterra.Documents.App.DTO.DocumentTagRelDto" + } + } } } } @@ -2776,9 +2786,14 @@ "description": "New property values", "required": true, "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Siterra.Documents.BusinessLogic.Entities.Document.DocumentClass" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Siterra.Documents.BusinessLogic.Entities.Document.DocumentClass" + } + } } } } @@ -3009,9 +3024,14 @@ "description": "New property values", "required": true, "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Siterra.Documents.BusinessLogic.Entities.Document.DocumentTagRel" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Siterra.Documents.BusinessLogic.Entities.Document.DocumentTagRel" + } + } } } } @@ -3914,9 +3934,14 @@ "description": "New property values", "required": true, "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Siterra.Documents.App.DTO.DocumentTagRelDto" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Siterra.Documents.App.DTO.DocumentTagRelDto" + } + } } } } 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 c77bf1b6..8f83378a 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 @@ -764,9 +764,12 @@ paths: description: New property values required: true schema: - type: array - items: - $ref: '#/definitions/Siterra.Documents.App.DTO.DocumentTagRelDto' + type: object + properties: + value: + type: array + items: + $ref: '#/definitions/Siterra.Documents.App.DTO.DocumentTagRelDto' responses: '204': description: Success @@ -1282,9 +1285,12 @@ paths: description: New property values required: true schema: - type: array - items: - $ref: '#/definitions/Siterra.Documents.App.DTO.DocumentTagRelDto' + type: object + properties: + value: + type: array + items: + $ref: '#/definitions/Siterra.Documents.App.DTO.DocumentTagRelDto' responses: '204': description: Success @@ -1982,9 +1988,12 @@ paths: description: New property values required: true schema: - type: array - items: - $ref: '#/definitions/Siterra.Documents.BusinessLogic.Entities.Document.DocumentClass' + type: object + properties: + value: + type: array + items: + $ref: '#/definitions/Siterra.Documents.BusinessLogic.Entities.Document.DocumentClass' responses: '204': description: Success @@ -2143,9 +2152,12 @@ paths: description: New property values required: true schema: - type: array - items: - $ref: '#/definitions/Siterra.Documents.BusinessLogic.Entities.Document.DocumentTagRel' + type: object + properties: + value: + type: array + items: + $ref: '#/definitions/Siterra.Documents.BusinessLogic.Entities.Document.DocumentTagRel' responses: '204': description: Success @@ -2782,9 +2794,12 @@ paths: description: New property values required: true schema: - type: array - items: - $ref: '#/definitions/Siterra.Documents.App.DTO.DocumentTagRelDto' + type: object + properties: + value: + type: array + items: + $ref: '#/definitions/Siterra.Documents.App.DTO.DocumentTagRelDto' 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 1fb9df64..a0d6d86b 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 @@ -1203,9 +1203,14 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Siterra.Documents.App.DTO.DocumentTagRelDto" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Siterra.Documents.App.DTO.DocumentTagRelDto" + } + } } } } @@ -2024,9 +2029,14 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Siterra.Documents.App.DTO.DocumentTagRelDto" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Siterra.Documents.App.DTO.DocumentTagRelDto" + } + } } } } @@ -3119,9 +3129,14 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Document.DocumentClass" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Document.DocumentClass" + } + } } } } @@ -3375,9 +3390,14 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Document.DocumentTagRel" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Document.DocumentTagRel" + } + } } } } @@ -4380,9 +4400,14 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Siterra.Documents.App.DTO.DocumentTagRelDto" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Siterra.Documents.App.DTO.DocumentTagRelDto" + } + } } } } 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 bbae78d1..fd0ea912 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 @@ -848,9 +848,12 @@ paths: content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/Siterra.Documents.App.DTO.DocumentTagRelDto' + type: object + properties: + value: + type: array + items: + $ref: '#/components/schemas/Siterra.Documents.App.DTO.DocumentTagRelDto' required: true responses: '204': @@ -1424,9 +1427,12 @@ paths: content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/Siterra.Documents.App.DTO.DocumentTagRelDto' + type: object + properties: + value: + type: array + items: + $ref: '#/components/schemas/Siterra.Documents.App.DTO.DocumentTagRelDto' required: true responses: '204': @@ -2209,9 +2215,12 @@ paths: content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Document.DocumentClass' + type: object + properties: + value: + type: array + items: + $ref: '#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Document.DocumentClass' required: true responses: '204': @@ -2385,9 +2394,12 @@ paths: content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Document.DocumentTagRel' + type: object + properties: + value: + type: array + items: + $ref: '#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Document.DocumentTagRel' required: true responses: '204': @@ -3091,9 +3103,12 @@ paths: content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/Siterra.Documents.App.DTO.DocumentTagRelDto' + type: object + properties: + value: + type: array + items: + $ref: '#/components/schemas/Siterra.Documents.App.DTO.DocumentTagRelDto' 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 a5aa271f..4f592e5c 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 @@ -903,9 +903,14 @@ "description": "New property values", "required": true, "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -1480,9 +1485,14 @@ "description": "New property values", "required": true, "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -1943,9 +1953,14 @@ "description": "New property values", "required": true, "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -2644,9 +2659,14 @@ "description": "New property values", "required": true, "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -3861,9 +3881,14 @@ "description": "New property values", "required": true, "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -4324,9 +4349,14 @@ "description": "New property values", "required": true, "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -4952,9 +4982,14 @@ "description": "New property values", "required": true, "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -6047,9 +6082,14 @@ "description": "New property values", "required": true, "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -7672,9 +7712,14 @@ "description": "New property values", "required": true, "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -8147,9 +8192,14 @@ "description": "New property values", "required": true, "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -8783,9 +8833,14 @@ "description": "New property values", "required": true, "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -9547,9 +9602,14 @@ "description": "New property values", "required": true, "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -12533,9 +12593,14 @@ "description": "New property values", "required": true, "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -13061,9 +13126,14 @@ "description": "New property values", "required": true, "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -13857,9 +13927,14 @@ "description": "New property values", "required": true, "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -16513,9 +16588,14 @@ "description": "New property values", "required": true, "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -17068,9 +17148,14 @@ "description": "New property values", "required": true, "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -17877,9 +17962,14 @@ "description": "New property values", "required": true, "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -19278,9 +19368,14 @@ "description": "New property values", "required": true, "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -19833,9 +19928,14 @@ "description": "New property values", "required": true, "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -20561,9 +20661,14 @@ "description": "New property values", "required": true, "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -21818,9 +21923,14 @@ "description": "New property values", "required": true, "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -23675,9 +23785,14 @@ "description": "New property values", "required": true, "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -24242,9 +24357,14 @@ "description": "New property values", "required": true, "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -24978,9 +25098,14 @@ "description": "New property values", "required": true, "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -25854,9 +25979,14 @@ "description": "New property values", "required": true, "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -30374,4 +30504,4 @@ "x-ms-docs-toc-type": "container" } ] -} +} \ No newline at end of file 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 f498dab3..80953d52 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 @@ -609,9 +609,12 @@ paths: description: New property values required: true schema: - type: array - items: - $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: '204': description: Success @@ -995,9 +998,12 @@ paths: description: New property values required: true schema: - type: array - items: - $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: '204': description: Success @@ -1315,9 +1321,12 @@ paths: description: New property values required: true schema: - type: array - items: - $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: '204': description: Success @@ -1809,9 +1818,12 @@ paths: description: New property values required: true schema: - type: array - items: - $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: '204': description: Success @@ -2667,9 +2679,12 @@ paths: description: New property values required: true schema: - type: array - items: - $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: '204': description: Success @@ -2987,9 +3002,12 @@ paths: description: New property values required: true schema: - type: array - items: - $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: '204': description: Success @@ -3426,9 +3444,12 @@ paths: description: New property values required: true schema: - type: array - items: - $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: '204': description: Success @@ -4194,9 +4215,12 @@ paths: description: New property values required: true schema: - type: array - items: - $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: '204': description: Success @@ -5338,9 +5362,12 @@ paths: description: New property values required: true schema: - type: array - items: - $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: '204': description: Success @@ -5666,9 +5693,12 @@ paths: description: New property values required: true schema: - type: array - items: - $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: '204': description: Success @@ -6110,9 +6140,12 @@ paths: description: New property values required: true schema: - type: array - items: - $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: '204': description: Success @@ -6640,9 +6673,12 @@ paths: description: New property values required: true schema: - type: array - items: - $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: '204': description: Success @@ -8754,9 +8790,12 @@ paths: description: New property values required: true schema: - type: array - items: - $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: '204': description: Success @@ -9117,9 +9156,12 @@ paths: description: New property values required: true schema: - type: array - items: - $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: '204': description: Success @@ -9678,9 +9720,12 @@ paths: description: New property values required: true schema: - type: array - items: - $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: '204': description: Success @@ -11532,9 +11577,12 @@ paths: description: New property values required: true schema: - type: array - items: - $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: '204': description: Success @@ -11920,9 +11968,12 @@ paths: description: New property values required: true schema: - type: array - items: - $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: '204': description: Success @@ -12494,9 +12545,12 @@ paths: description: New property values required: true schema: - type: array - items: - $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: '204': description: Success @@ -13489,9 +13543,12 @@ paths: description: New property values required: true schema: - type: array - items: - $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: '204': description: Success @@ -13877,9 +13934,12 @@ paths: description: New property values required: true schema: - type: array - items: - $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: '204': description: Success @@ -14390,9 +14450,12 @@ paths: description: New property values required: true schema: - type: array - items: - $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: '204': description: Success @@ -15279,9 +15342,12 @@ paths: description: New property values required: true schema: - type: array - items: - $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: '204': description: Success @@ -16596,9 +16662,12 @@ paths: description: New property values required: true schema: - type: array - items: - $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: '204': description: Success @@ -16992,9 +17061,12 @@ paths: description: New property values required: true schema: - type: array - items: - $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: '204': description: Success @@ -17510,9 +17582,12 @@ paths: description: New property values required: true schema: - type: array - items: - $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: '204': description: Success @@ -18124,9 +18199,12 @@ paths: description: New property values required: true schema: - type: array - items: - $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' responses: '204': description: Success @@ -21264,4 +21342,4 @@ tags: - name: People.Actions x-ms-docs-toc-type: container - name: ResetDataSource - x-ms-docs-toc-type: container + x-ms-docs-toc-type: container \ No newline at end of file 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 d9057b91..c9896025 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json @@ -1017,9 +1017,14 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -1683,9 +1688,14 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -2168,9 +2178,14 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -2939,9 +2954,14 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -4271,9 +4291,14 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -4756,9 +4781,14 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -5443,9 +5473,14 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -6641,9 +6676,14 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -8431,9 +8471,14 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -8944,9 +8989,14 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -9655,9 +9705,14 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -10502,9 +10557,14 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -13814,9 +13874,14 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -14408,9 +14473,14 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -15318,9 +15388,14 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -18352,9 +18427,14 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -18957,9 +19037,14 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -19864,9 +19949,14 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -21438,9 +21528,14 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -22043,9 +22138,14 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -22856,9 +22956,14 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -24260,9 +24365,14 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -26354,9 +26464,14 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -26987,9 +27102,14 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -27824,9 +27944,14 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -28813,9 +28938,14 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location" + } + } } } } @@ -34231,4 +34361,4 @@ "x-ms-docs-toc-type": "container" } ] -} +} \ No newline at end of file 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 5126a819..98263898 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml @@ -684,9 +684,12 @@ paths: content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' required: true responses: '204': @@ -1116,9 +1119,12 @@ paths: content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' required: true responses: '204': @@ -1453,9 +1459,12 @@ paths: content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' required: true responses: '204': @@ -1997,9 +2006,12 @@ paths: content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' required: true responses: '204': @@ -2939,9 +2951,12 @@ paths: content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' required: true responses: '204': @@ -3276,9 +3291,12 @@ paths: content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' required: true responses: '204': @@ -3757,9 +3775,12 @@ paths: content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' required: true responses: '204': @@ -4598,9 +4619,12 @@ paths: content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' required: true responses: '204': @@ -5855,9 +5879,12 @@ paths: content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' required: true responses: '204': @@ -6210,9 +6237,12 @@ paths: content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' required: true responses: '204': @@ -6706,9 +6736,12 @@ paths: content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' required: true responses: '204': @@ -7292,9 +7325,12 @@ paths: content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' required: true responses: '204': @@ -9623,9 +9659,12 @@ paths: content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' required: true responses: '204': @@ -10027,9 +10066,12 @@ paths: content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' required: true responses: '204': @@ -10662,9 +10704,12 @@ paths: content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' required: true responses: '204': @@ -12758,9 +12803,12 @@ paths: content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' required: true responses: '204': @@ -13177,9 +13225,12 @@ paths: content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' required: true responses: '204': @@ -13815,9 +13866,12 @@ paths: content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' required: true responses: '204': @@ -14924,9 +14978,12 @@ paths: content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' required: true responses: '204': @@ -15343,9 +15400,12 @@ paths: content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' required: true responses: '204': @@ -15911,9 +15971,12 @@ paths: content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' required: true responses: '204': @@ -16895,9 +16958,12 @@ paths: content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' required: true responses: '204': @@ -18362,9 +18428,12 @@ paths: content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' required: true responses: '204': @@ -18799,9 +18868,12 @@ paths: content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' required: true responses: '204': @@ -19382,9 +19454,12 @@ paths: content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' required: true responses: '204': @@ -20067,9 +20142,12 @@ paths: content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' + type: object + properties: + value: + type: array + items: + $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' required: true responses: '204': @@ -23731,4 +23809,4 @@ tags: - name: People.Actions x-ms-docs-toc-type: container - name: ResetDataSource - x-ms-docs-toc-type: container + x-ms-docs-toc-type: container \ No newline at end of file