From 2ba3d72a4a42a8f94a4bcee3f34c13f60ae96174 Mon Sep 17 00:00:00 2001 From: Darrel Miller Date: Sat, 15 Aug 2020 18:18:15 -0400 Subject: [PATCH 1/5] Fixed non-contained reference collections --- .../Edm/ODataPathProvider.cs | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/Edm/ODataPathProvider.cs b/src/Microsoft.OpenApi.OData.Reader/Edm/ODataPathProvider.cs index 4273bb73..f49b09f8 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Edm/ODataPathProvider.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Edm/ODataPathProvider.cs @@ -216,6 +216,7 @@ private void RetrieveNavigationPropertyPaths(IEdmNavigationProperty navigationPr // append a navigation property. currentPath.Push(new ODataNavigationPropertySegment(navigationProperty)); AppendPath(currentPath.Clone()); + IEdmEntityType navEntityType = navigationProperty.ToEntityType(); if (!navigationProperty.ContainsTarget) { @@ -226,40 +227,39 @@ private void RetrieveNavigationPropertyPaths(IEdmNavigationProperty navigationPr newPath.Push(ODataRefSegment.Instance); // $ref AppendPath(newPath); } - - // append a navigation property key. - IEdmEntityType navEntityType = navigationProperty.ToEntityType(); - if (navigationProperty.TargetMultiplicity() == EdmMultiplicity.Many) + else { - currentPath.Push(new ODataKeySegment(navEntityType)); - AppendPath(currentPath.Clone()); - - if (!navigationProperty.ContainsTarget) + // append a navigation property key. + if (navigationProperty.TargetMultiplicity() == EdmMultiplicity.Many) { - // TODO: Shall we add "$ref" after {key}, and only support delete? - // ODataPath newPath = currentPath.Clone(); - // newPath.Push(ODataRefSegment.Instance); // $ref - // AppendPath(newPath); + currentPath.Push(new ODataKeySegment(navEntityType)); + AppendPath(currentPath.Clone()); + + if (!navigationProperty.ContainsTarget) + { + // TODO: Shall we add "$ref" after {key}, and only support delete? + // ODataPath newPath = currentPath.Clone(); + // newPath.Push(ODataRefSegment.Instance); // $ref + // AppendPath(newPath); + } } - } - if (shouldExpand) - { - // expand to sub navigation properties - foreach (IEdmNavigationProperty subNavProperty in navEntityType.DeclaredNavigationProperties()) + if (shouldExpand) { - if (CanFilter(subNavProperty)) + // expand to sub navigation properties + foreach (IEdmNavigationProperty subNavProperty in navEntityType.DeclaredNavigationProperties()) { - RetrieveNavigationPropertyPaths(subNavProperty, currentPath); + if (CanFilter(subNavProperty)) + { + RetrieveNavigationPropertyPaths(subNavProperty, currentPath); + } } } + if (navigationProperty.TargetMultiplicity() == EdmMultiplicity.Many) + { + currentPath.Pop(); + } } - - if (navigationProperty.TargetMultiplicity() == EdmMultiplicity.Many) - { - currentPath.Pop(); - } - currentPath.Pop(); } From 6f4b2faea27365f4e3b35d4e62fc29253e041b5b Mon Sep 17 00:00:00 2001 From: Darrel Miller Date: Tue, 18 Aug 2020 10:03:45 -0400 Subject: [PATCH 2/5] Fix some tests --- .../Edm/ODataPathProviderTests.cs | 39 +- .../Resources/Multiple.Schema.OpenApi.V2.json | 263 ------ .../Resources/Multiple.Schema.OpenApi.V2.yaml | 200 ----- .../Resources/Multiple.Schema.OpenApi.json | 335 -------- .../Resources/Multiple.Schema.OpenApi.yaml | 248 ------ .../Resources/TripService.OpenApi.json | 756 +----------------- 6 files changed, 56 insertions(+), 1785 deletions(-) diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Edm/ODataPathProviderTests.cs b/test/Microsoft.OpenAPI.OData.Reader.Tests/Edm/ODataPathProviderTests.cs index e17177af..f939bf98 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Edm/ODataPathProviderTests.cs +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Edm/ODataPathProviderTests.cs @@ -45,7 +45,7 @@ public void GetPathsForGraphBetaModelReturnsAllPaths() // Assert Assert.NotNull(paths); - Assert.Equal(4583, paths.Count()); + Assert.Equal(4455, paths.Count()); } [Fact] @@ -150,7 +150,7 @@ public void GetPathsWithUnboundOperationImportWorks() } [Fact] - public void GetPathsWithNavigationPropertytWorks() + public void GetPathsWithNonContainedNavigationPropertytWorks() { // Arrange string entityType = @@ -172,16 +172,47 @@ public void GetPathsWithNavigationPropertytWorks() // Assert Assert.NotNull(paths); - Assert.Equal(9, paths.Count()); + Assert.Equal(8, paths.Count()); var pathItems = paths.Select(p => p.GetPathItemName()).ToList(); Assert.Contains("/Orders({id})/MultipleCustomers", pathItems); - Assert.Contains("/Orders({id})/MultipleCustomers({ID})", pathItems); Assert.Contains("/Orders({id})/SingleCustomer", pathItems); Assert.Contains("/Orders({id})/SingleCustomer/$ref", pathItems); Assert.Contains("/Orders({id})/MultipleCustomers/$ref", pathItems); } + [Fact] + public void GetPathsWithContainedNavigationPropertytWorks() + { + // Arrange + string entityType = +@" + + + + + + "; + + string entitySet = @""; + IEdmModel model = GetEdmModel(entityType, entitySet); + + ODataPathProvider provider = new ODataPathProvider(); + + // Act + var paths = provider.GetPaths(model); + + // Assert + Assert.NotNull(paths); + Assert.Equal(7, paths.Count()); + + var pathItems = paths.Select(p => p.GetPathItemName()).ToList(); + Assert.Contains("/Orders({id})/MultipleCustomers", pathItems); + Assert.Contains("/Orders({id})/MultipleCustomers({ID})", pathItems); + Assert.Contains("/Orders({id})/SingleCustomer", pathItems); + } + + private static IEdmModel GetEdmModel(string schemaElement, string containerElement) { string template = @" 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..c88d2f0c 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 @@ -773,96 +773,6 @@ "x-ms-docs-operation-type": "operation" } }, - "/Documents({Id})/Revisions({Id1})": { - "get": { - "tags": [ - "Documents.RevisionDto" - ], - "summary": "Get Revisions from Documents", - "operationId": "Documents.GetRevisions", - "produces": [ - "application/json" - ], - "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": "path", - "name": "Id1", - "description": "key: Id of RevisionDto", - "required": true, - "type": "integer", - "format": "int32", - "maximum": 2147483647, - "minimum": -2147483648, - "x-ms-docs-key-type": "RevisionDto" - }, - { - "in": "query", - "name": "$select", - "description": "Select properties to be returned", - "type": "array", - "items": { - "enum": [ - "Id", - "Number", - "DocumentId", - "DocumentName", - "DocumentDescription", - "CreationDate", - "CreatedBy", - "IsReviewed", - "ReviewedBy", - "ReviewedDate", - "IsApproved", - "ApprovedBy", - "ApprovedDate", - "IsRejected", - "RejectedBy", - "RejectedDate", - "DomainId", - "Document" - ], - "type": "string" - } - }, - { - "in": "query", - "name": "$expand", - "description": "Expand related entities", - "type": "array", - "items": { - "enum": [ - "*", - "Document" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Retrieved navigation property", - "schema": { - "$ref": "#/definitions/Siterra.Documents.App.DTO.RevisionDto" - } - }, - "default": { - "$ref": "#/responses/error" - } - }, - "x-ms-docs-operation-type": "operation" - } - }, "/Documents({Id})/Revisions/$ref": { "get": { "tags": [ @@ -1465,89 +1375,6 @@ "x-ms-docs-operation-type": "operation" } }, - "/Libraries({Id})/Documents({Id1})": { - "get": { - "tags": [ - "Libraries.DocumentDto" - ], - "summary": "Get Documents from Libraries", - "operationId": "Libraries.GetDocuments", - "produces": [ - "application/json" - ], - "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": "path", - "name": "Id1", - "description": "key: Id of DocumentDto", - "required": true, - "type": "integer", - "format": "int32", - "maximum": 2147483647, - "minimum": -2147483648, - "x-ms-docs-key-type": "DocumentDto" - }, - { - "in": "query", - "name": "$select", - "description": "Select properties to be returned", - "type": "array", - "items": { - "enum": [ - "Id", - "Name", - "Description", - "Filename", - "NumberOfRevisions", - "Suffix", - "DomainId", - "ModificationDate", - "ModifiedBy", - "Tags", - "Revisions" - ], - "type": "string" - } - }, - { - "in": "query", - "name": "$expand", - "description": "Expand related entities", - "type": "array", - "items": { - "enum": [ - "*", - "Revisions" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Retrieved navigation property", - "schema": { - "$ref": "#/definitions/Siterra.Documents.App.DTO.DocumentDto" - } - }, - "default": { - "$ref": "#/responses/error" - } - }, - "x-ms-docs-operation-type": "operation" - } - }, "/Libraries({Id})/Documents/$ref": { "get": { "tags": [ @@ -2733,96 +2560,6 @@ "x-ms-docs-operation-type": "operation" } }, - "/Tasks({Id})/Revisions({Id1})": { - "get": { - "tags": [ - "Tasks.RevisionDto" - ], - "summary": "Get Revisions from Tasks", - "operationId": "Tasks.GetRevisions", - "produces": [ - "application/json" - ], - "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": "path", - "name": "Id1", - "description": "key: Id of RevisionDto", - "required": true, - "type": "integer", - "format": "int32", - "maximum": 2147483647, - "minimum": -2147483648, - "x-ms-docs-key-type": "RevisionDto" - }, - { - "in": "query", - "name": "$select", - "description": "Select properties to be returned", - "type": "array", - "items": { - "enum": [ - "Id", - "Number", - "DocumentId", - "DocumentName", - "DocumentDescription", - "CreationDate", - "CreatedBy", - "IsReviewed", - "ReviewedBy", - "ReviewedDate", - "IsApproved", - "ApprovedBy", - "ApprovedDate", - "IsRejected", - "RejectedBy", - "RejectedDate", - "DomainId", - "Document" - ], - "type": "string" - } - }, - { - "in": "query", - "name": "$expand", - "description": "Expand related entities", - "type": "array", - "items": { - "enum": [ - "*", - "Document" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Retrieved navigation property", - "schema": { - "$ref": "#/definitions/Siterra.Documents.App.DTO.RevisionDto" - } - }, - "default": { - "$ref": "#/responses/error" - } - }, - "x-ms-docs-operation-type": "operation" - } - }, "/Tasks({Id})/Revisions/$ref": { "get": { "tags": [ 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..4397f1f3 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 @@ -549,75 +549,6 @@ paths: default: $ref: '#/responses/error' x-ms-docs-operation-type: operation - '/Documents({Id})/Revisions({Id1})': - get: - tags: - - Documents.RevisionDto - summary: Get Revisions from Documents - operationId: Documents.GetRevisions - produces: - - application/json - 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: path - name: Id1 - description: 'key: Id of RevisionDto' - required: true - type: integer - format: int32 - maximum: 2147483647 - minimum: -2147483648 - x-ms-docs-key-type: RevisionDto - - in: query - name: $select - description: Select properties to be returned - type: array - items: - enum: - - Id - - Number - - DocumentId - - DocumentName - - DocumentDescription - - CreationDate - - CreatedBy - - IsReviewed - - ReviewedBy - - ReviewedDate - - IsApproved - - ApprovedBy - - ApprovedDate - - IsRejected - - RejectedBy - - RejectedDate - - DomainId - - Document - type: string - - in: query - name: $expand - description: Expand related entities - type: array - items: - enum: - - '*' - - Document - type: string - responses: - '200': - description: Retrieved navigation property - schema: - $ref: '#/definitions/Siterra.Documents.App.DTO.RevisionDto' - default: - $ref: '#/responses/error' - x-ms-docs-operation-type: operation '/Documents({Id})/Revisions/$ref': get: tags: @@ -1054,68 +985,6 @@ paths: default: $ref: '#/responses/error' x-ms-docs-operation-type: operation - '/Libraries({Id})/Documents({Id1})': - get: - tags: - - Libraries.DocumentDto - summary: Get Documents from Libraries - operationId: Libraries.GetDocuments - produces: - - application/json - 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: path - name: Id1 - description: 'key: Id of DocumentDto' - required: true - type: integer - format: int32 - maximum: 2147483647 - minimum: -2147483648 - x-ms-docs-key-type: DocumentDto - - in: query - name: $select - description: Select properties to be returned - type: array - items: - enum: - - Id - - Name - - Description - - Filename - - NumberOfRevisions - - Suffix - - DomainId - - ModificationDate - - ModifiedBy - - Tags - - Revisions - type: string - - in: query - name: $expand - description: Expand related entities - type: array - items: - enum: - - '*' - - Revisions - type: string - responses: - '200': - description: Retrieved navigation property - schema: - $ref: '#/definitions/Siterra.Documents.App.DTO.DocumentDto' - default: - $ref: '#/responses/error' - x-ms-docs-operation-type: operation '/Libraries({Id})/Documents/$ref': get: tags: @@ -1984,75 +1853,6 @@ paths: default: $ref: '#/responses/error' x-ms-docs-operation-type: operation - '/Tasks({Id})/Revisions({Id1})': - get: - tags: - - Tasks.RevisionDto - summary: Get Revisions from Tasks - operationId: Tasks.GetRevisions - produces: - - application/json - 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: path - name: Id1 - description: 'key: Id of RevisionDto' - required: true - type: integer - format: int32 - maximum: 2147483647 - minimum: -2147483648 - x-ms-docs-key-type: RevisionDto - - in: query - name: $select - description: Select properties to be returned - type: array - items: - enum: - - Id - - Number - - DocumentId - - DocumentName - - DocumentDescription - - CreationDate - - CreatedBy - - IsReviewed - - ReviewedBy - - ReviewedDate - - IsApproved - - ApprovedBy - - ApprovedDate - - IsRejected - - RejectedBy - - RejectedDate - - DomainId - - Document - type: string - - in: query - name: $expand - description: Expand related entities - type: array - items: - enum: - - '*' - - Document - type: string - responses: - '200': - description: Retrieved navigation property - schema: - $ref: '#/definitions/Siterra.Documents.App.DTO.RevisionDto' - default: - $ref: '#/responses/error' - x-ms-docs-operation-type: operation '/Tasks({Id})/Revisions/$ref': get: tags: 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..6381aa23 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 @@ -867,120 +867,6 @@ "x-ms-docs-operation-type": "operation" } }, - "/Documents({Id})/Revisions({Id1})": { - "get": { - "tags": [ - "Documents.RevisionDto" - ], - "summary": "Get Revisions from Documents", - "operationId": "Documents.GetRevisions", - "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": "Id1", - "in": "path", - "description": "key: Id of RevisionDto", - "required": true, - "schema": { - "maximum": 2147483647, - "minimum": -2147483648, - "type": "integer", - "format": "int32" - }, - "x-ms-docs-key-type": "RevisionDto" - }, - { - "name": "$select", - "in": "query", - "description": "Select properties to be returned", - "style": "form", - "explode": false, - "schema": { - "uniqueItems": true, - "type": "array", - "items": { - "enum": [ - "Id", - "Number", - "DocumentId", - "DocumentName", - "DocumentDescription", - "CreationDate", - "CreatedBy", - "IsReviewed", - "ReviewedBy", - "ReviewedDate", - "IsApproved", - "ApprovedBy", - "ApprovedDate", - "IsRejected", - "RejectedBy", - "RejectedDate", - "DomainId", - "Document" - ], - "type": "string" - } - } - }, - { - "name": "$expand", - "in": "query", - "description": "Expand related entities", - "style": "form", - "explode": false, - "schema": { - "uniqueItems": true, - "type": "array", - "items": { - "enum": [ - "*", - "Document" - ], - "type": "string" - } - } - } - ], - "responses": { - "200": { - "description": "Retrieved navigation property", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Siterra.Documents.App.DTO.RevisionDto" - } - } - }, - "links": { - "Document": { - "operationId": "Documents.Revisions.GetDocument", - "parameters": { - "Id": "$request.path.Id", - "Id1": "$request.path.Id1" - } - } - } - }, - "default": { - "$ref": "#/components/responses/error" - } - }, - "x-ms-docs-operation-type": "operation" - } - }, "/Documents({Id})/Revisions/$ref": { "get": { "tags": [ @@ -1651,113 +1537,6 @@ "x-ms-docs-operation-type": "operation" } }, - "/Libraries({Id})/Documents({Id1})": { - "get": { - "tags": [ - "Libraries.DocumentDto" - ], - "summary": "Get Documents from Libraries", - "operationId": "Libraries.GetDocuments", - "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": "Id1", - "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": "$select", - "in": "query", - "description": "Select properties to be returned", - "style": "form", - "explode": false, - "schema": { - "uniqueItems": true, - "type": "array", - "items": { - "enum": [ - "Id", - "Name", - "Description", - "Filename", - "NumberOfRevisions", - "Suffix", - "DomainId", - "ModificationDate", - "ModifiedBy", - "Tags", - "Revisions" - ], - "type": "string" - } - } - }, - { - "name": "$expand", - "in": "query", - "description": "Expand related entities", - "style": "form", - "explode": false, - "schema": { - "uniqueItems": true, - "type": "array", - "items": { - "enum": [ - "*", - "Revisions" - ], - "type": "string" - } - } - } - ], - "responses": { - "200": { - "description": "Retrieved navigation property", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Siterra.Documents.App.DTO.DocumentDto" - } - } - }, - "links": { - "Revisions": { - "operationId": "Libraries.Documents.ListRevisions", - "parameters": { - "Id": "$request.path.Id", - "Id1": "$request.path.Id1" - } - } - } - }, - "default": { - "$ref": "#/components/responses/error" - } - }, - "x-ms-docs-operation-type": "operation" - } - }, "/Libraries({Id})/Documents/$ref": { "get": { "tags": [ @@ -3139,120 +2918,6 @@ "x-ms-docs-operation-type": "operation" } }, - "/Tasks({Id})/Revisions({Id1})": { - "get": { - "tags": [ - "Tasks.RevisionDto" - ], - "summary": "Get Revisions from Tasks", - "operationId": "Tasks.GetRevisions", - "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": "Id1", - "in": "path", - "description": "key: Id of RevisionDto", - "required": true, - "schema": { - "maximum": 2147483647, - "minimum": -2147483648, - "type": "integer", - "format": "int32" - }, - "x-ms-docs-key-type": "RevisionDto" - }, - { - "name": "$select", - "in": "query", - "description": "Select properties to be returned", - "style": "form", - "explode": false, - "schema": { - "uniqueItems": true, - "type": "array", - "items": { - "enum": [ - "Id", - "Number", - "DocumentId", - "DocumentName", - "DocumentDescription", - "CreationDate", - "CreatedBy", - "IsReviewed", - "ReviewedBy", - "ReviewedDate", - "IsApproved", - "ApprovedBy", - "ApprovedDate", - "IsRejected", - "RejectedBy", - "RejectedDate", - "DomainId", - "Document" - ], - "type": "string" - } - } - }, - { - "name": "$expand", - "in": "query", - "description": "Expand related entities", - "style": "form", - "explode": false, - "schema": { - "uniqueItems": true, - "type": "array", - "items": { - "enum": [ - "*", - "Document" - ], - "type": "string" - } - } - } - ], - "responses": { - "200": { - "description": "Retrieved navigation property", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Siterra.Documents.App.DTO.RevisionDto" - } - } - }, - "links": { - "Document": { - "operationId": "Tasks.Revisions.GetDocument", - "parameters": { - "Id": "$request.path.Id", - "Id1": "$request.path.Id1" - } - } - } - }, - "default": { - "$ref": "#/components/responses/error" - } - }, - "x-ms-docs-operation-type": "operation" - } - }, "/Tasks({Id})/Revisions/$ref": { "get": { "tags": [ 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..8fa81a80 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 @@ -609,91 +609,6 @@ paths: default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation - '/Documents({Id})/Revisions({Id1})': - get: - tags: - - Documents.RevisionDto - summary: Get Revisions from Documents - operationId: Documents.GetRevisions - 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: Id1 - in: path - description: 'key: Id of RevisionDto' - required: true - schema: - maximum: 2147483647 - minimum: -2147483648 - type: integer - format: int32 - x-ms-docs-key-type: RevisionDto - - name: $select - in: query - description: Select properties to be returned - style: form - explode: false - schema: - uniqueItems: true - type: array - items: - enum: - - Id - - Number - - DocumentId - - DocumentName - - DocumentDescription - - CreationDate - - CreatedBy - - IsReviewed - - ReviewedBy - - ReviewedDate - - IsApproved - - ApprovedBy - - ApprovedDate - - IsRejected - - RejectedBy - - RejectedDate - - DomainId - - Document - type: string - - name: $expand - in: query - description: Expand related entities - style: form - explode: false - schema: - uniqueItems: true - type: array - items: - enum: - - '*' - - Document - type: string - responses: - '200': - description: Retrieved navigation property - content: - application/json: - schema: - $ref: '#/components/schemas/Siterra.Documents.App.DTO.RevisionDto' - links: - Document: - operationId: Documents.Revisions.GetDocument - parameters: - Id: $request.path.Id - Id1: $request.path.Id1 - default: - $ref: '#/components/responses/error' - x-ms-docs-operation-type: operation '/Documents({Id})/Revisions/$ref': get: tags: @@ -1174,84 +1089,6 @@ paths: default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation - '/Libraries({Id})/Documents({Id1})': - get: - tags: - - Libraries.DocumentDto - summary: Get Documents from Libraries - operationId: Libraries.GetDocuments - 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: Id1 - 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: $select - in: query - description: Select properties to be returned - style: form - explode: false - schema: - uniqueItems: true - type: array - items: - enum: - - Id - - Name - - Description - - Filename - - NumberOfRevisions - - Suffix - - DomainId - - ModificationDate - - ModifiedBy - - Tags - - Revisions - type: string - - name: $expand - in: query - description: Expand related entities - style: form - explode: false - schema: - uniqueItems: true - type: array - items: - enum: - - '*' - - Revisions - type: string - responses: - '200': - description: Retrieved navigation property - content: - application/json: - schema: - $ref: '#/components/schemas/Siterra.Documents.App.DTO.DocumentDto' - links: - Revisions: - operationId: Libraries.Documents.ListRevisions - parameters: - Id: $request.path.Id - Id1: $request.path.Id1 - default: - $ref: '#/components/responses/error' - x-ms-docs-operation-type: operation '/Libraries({Id})/Documents/$ref': get: tags: @@ -2245,91 +2082,6 @@ paths: default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation - '/Tasks({Id})/Revisions({Id1})': - get: - tags: - - Tasks.RevisionDto - summary: Get Revisions from Tasks - operationId: Tasks.GetRevisions - 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: Id1 - in: path - description: 'key: Id of RevisionDto' - required: true - schema: - maximum: 2147483647 - minimum: -2147483648 - type: integer - format: int32 - x-ms-docs-key-type: RevisionDto - - name: $select - in: query - description: Select properties to be returned - style: form - explode: false - schema: - uniqueItems: true - type: array - items: - enum: - - Id - - Number - - DocumentId - - DocumentName - - DocumentDescription - - CreationDate - - CreatedBy - - IsReviewed - - ReviewedBy - - ReviewedDate - - IsApproved - - ApprovedBy - - ApprovedDate - - IsRejected - - RejectedBy - - RejectedDate - - DomainId - - Document - type: string - - name: $expand - in: query - description: Expand related entities - style: form - explode: false - schema: - uniqueItems: true - type: array - items: - enum: - - '*' - - Document - type: string - responses: - '200': - description: Retrieved navigation property - content: - application/json: - schema: - $ref: '#/components/schemas/Siterra.Documents.App.DTO.RevisionDto' - links: - Document: - operationId: Tasks.Revisions.GetDocument - parameters: - Id: $request.path.Id - Id1: $request.path.Id1 - default: - $ref: '#/components/responses/error' - x-ms-docs-operation-type: operation '/Tasks({Id})/Revisions/$ref': get: tags: 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..5ab87485 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json @@ -1100,93 +1100,6 @@ "x-ms-docs-operation-type": "operation" } }, - "/Me/Friends/{UserName}": { - "get": { - "tags": [ - "Me.Person" - ], - "summary": "Get Friends from Me", - "operationId": "Me.GetFriends", - "parameters": [ - { - "name": "UserName", - "in": "path", - "description": "key: UserName of Person", - "required": true, - "schema": { - "type": "string" - }, - "x-ms-docs-key-type": "Person" - }, - { - "name": "$select", - "in": "query", - "description": "Select properties to be returned", - "style": "form", - "explode": false, - "schema": { - "uniqueItems": true, - "type": "array", - "items": { - "enum": [ - "UserName", - "FirstName", - "LastName", - "MiddleName", - "Gender", - "Age", - "Emails", - "AddressInfo", - "HomeAddress", - "FavoriteFeature", - "Features", - "Friends", - "BestFriend", - "Trips" - ], - "type": "string" - } - } - }, - { - "name": "$expand", - "in": "query", - "description": "Expand related entities", - "style": "form", - "explode": false, - "schema": { - "uniqueItems": true, - "type": "array", - "items": { - "enum": [ - "*", - "Friends", - "BestFriend", - "Trips" - ], - "type": "string" - } - } - } - ], - "responses": { - "200": { - "description": "Retrieved navigation property", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person" - } - } - } - }, - "default": { - "$ref": "#/components/responses/error" - } - }, - "x-ms-docs-operation-type": "operation" - } - }, "/Me/Friends/$ref": { "get": { "tags": [ @@ -1643,137 +1556,6 @@ "x-ms-docs-operation-type": "operation" } }, - "/Me/Trips/{TripId}": { - "get": { - "tags": [ - "Me.Trip" - ], - "summary": "Get Trips from Me", - "operationId": "Me.GetTrips", - "parameters": [ - { - "name": "TripId", - "in": "path", - "description": "key: TripId of Trip", - "required": true, - "schema": { - "maximum": 2147483647, - "minimum": -2147483648, - "type": "integer", - "format": "int32" - }, - "x-ms-docs-key-type": "Trip" - }, - { - "name": "$select", - "in": "query", - "description": "Select properties to be returned", - "style": "form", - "explode": false, - "schema": { - "uniqueItems": true, - "type": "array", - "items": { - "enum": [ - "TripId", - "ShareId", - "Name", - "Budget", - "Description", - "Tags", - "StartsAt", - "EndsAt", - "PlanItems" - ], - "type": "string" - } - } - }, - { - "name": "$expand", - "in": "query", - "description": "Expand related entities", - "style": "form", - "explode": false, - "schema": { - "uniqueItems": true, - "type": "array", - "items": { - "enum": [ - "*", - "PlanItems" - ], - "type": "string" - } - } - } - ], - "responses": { - "200": { - "description": "Retrieved navigation property", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip" - } - } - } - }, - "default": { - "$ref": "#/components/responses/error" - } - }, - "x-ms-docs-operation-type": "operation" - } - }, - "/Me/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()": { - "get": { - "tags": [ - "Me.Functions" - ], - "summary": "Invoke function GetInvolvedPeople", - "operationId": "Me.Trips.GetInvolvedPeople", - "parameters": [ - { - "name": "TripId", - "in": "path", - "description": "key: TripId of Trip", - "required": true, - "schema": { - "maximum": 2147483647, - "minimum": -2147483648, - "type": "integer", - "format": "int32" - }, - "x-ms-docs-key-type": "Trip" - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person" - } - ], - "nullable": true - } - } - } - } - }, - "default": { - "$ref": "#/components/responses/error" - } - }, - "x-ms-docs-operation-type": "function" - } - }, "/Me/Trips/$ref": { "get": { "tags": [ @@ -2579,103 +2361,6 @@ "x-ms-docs-operation-type": "operation" } }, - "/NewComePeople/{UserName}/Friends/{UserName1}": { - "get": { - "tags": [ - "NewComePeople.Person" - ], - "summary": "Get Friends from NewComePeople", - "operationId": "NewComePeople.GetFriends", - "parameters": [ - { - "name": "UserName", - "in": "path", - "description": "key: UserName of Person", - "required": true, - "schema": { - "type": "string" - }, - "x-ms-docs-key-type": "Person" - }, - { - "name": "UserName1", - "in": "path", - "description": "key: UserName of Person", - "required": true, - "schema": { - "type": "string" - }, - "x-ms-docs-key-type": "Person" - }, - { - "name": "$select", - "in": "query", - "description": "Select properties to be returned", - "style": "form", - "explode": false, - "schema": { - "uniqueItems": true, - "type": "array", - "items": { - "enum": [ - "UserName", - "FirstName", - "LastName", - "MiddleName", - "Gender", - "Age", - "Emails", - "AddressInfo", - "HomeAddress", - "FavoriteFeature", - "Features", - "Friends", - "BestFriend", - "Trips" - ], - "type": "string" - } - } - }, - { - "name": "$expand", - "in": "query", - "description": "Expand related entities", - "style": "form", - "explode": false, - "schema": { - "uniqueItems": true, - "type": "array", - "items": { - "enum": [ - "*", - "Friends", - "BestFriend", - "Trips" - ], - "type": "string" - } - } - } - ], - "responses": { - "200": { - "description": "Retrieved navigation property", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person" - } - } - } - }, - "default": { - "$ref": "#/components/responses/error" - } - }, - "x-ms-docs-operation-type": "operation" - } - }, "/NewComePeople/{UserName}/Friends/$ref": { "get": { "tags": [ @@ -3179,186 +2864,35 @@ "in": "query", "description": "Expand related entities", "style": "form", - "explode": false, - "schema": { - "uniqueItems": true, - "type": "array", - "items": { - "enum": [ - "*", - "PlanItems" - ], - "type": "string" - } - } - } - ], - "responses": { - "200": { - "description": "Retrieved navigation property", - "content": { - "application/json": { - "schema": { - "title": "Collection of Trip", - "type": "object", - "properties": { - "value": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip" - } - } - } - } - } - } - }, - "default": { - "$ref": "#/components/responses/error" - } - }, - "x-ms-docs-operation-type": "operation" - } - }, - "/NewComePeople/{UserName}/Trips/{TripId}": { - "get": { - "tags": [ - "NewComePeople.Trip" - ], - "summary": "Get Trips from NewComePeople", - "operationId": "NewComePeople.GetTrips", - "parameters": [ - { - "name": "UserName", - "in": "path", - "description": "key: UserName of Person", - "required": true, - "schema": { - "type": "string" - }, - "x-ms-docs-key-type": "Person" - }, - { - "name": "TripId", - "in": "path", - "description": "key: TripId of Trip", - "required": true, - "schema": { - "maximum": 2147483647, - "minimum": -2147483648, - "type": "integer", - "format": "int32" - }, - "x-ms-docs-key-type": "Trip" - }, - { - "name": "$select", - "in": "query", - "description": "Select properties to be returned", - "style": "form", - "explode": false, - "schema": { - "uniqueItems": true, - "type": "array", - "items": { - "enum": [ - "TripId", - "ShareId", - "Name", - "Budget", - "Description", - "Tags", - "StartsAt", - "EndsAt", - "PlanItems" - ], - "type": "string" - } - } - }, - { - "name": "$expand", - "in": "query", - "description": "Expand related entities", - "style": "form", - "explode": false, - "schema": { - "uniqueItems": true, - "type": "array", - "items": { - "enum": [ - "*", - "PlanItems" - ], - "type": "string" - } - } - } - ], - "responses": { - "200": { - "description": "Retrieved navigation property", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip" - } - } - } - }, - "default": { - "$ref": "#/components/responses/error" - } - }, - "x-ms-docs-operation-type": "operation" - } - }, - "/NewComePeople/{UserName}/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()": { - "get": { - "tags": [ - "NewComePeople.Functions" - ], - "summary": "Invoke function GetInvolvedPeople", - "operationId": "NewComePeople.Trips.GetInvolvedPeople", - "parameters": [ - { - "name": "UserName", - "in": "path", - "description": "key: UserName of Person", - "required": true, - "schema": { - "type": "string" - }, - "x-ms-docs-key-type": "Person" - }, - { - "name": "TripId", - "in": "path", - "description": "key: TripId of Trip", - "required": true, + "explode": false, "schema": { - "maximum": 2147483647, - "minimum": -2147483648, - "type": "integer", - "format": "int32" - }, - "x-ms-docs-key-type": "Trip" + "uniqueItems": true, + "type": "array", + "items": { + "enum": [ + "*", + "PlanItems" + ], + "type": "string" + } + } } ], "responses": { "200": { - "description": "Success", + "description": "Retrieved navigation property", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person" + "title": "Collection of Trip", + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip" } - ], - "nullable": true + } } } } @@ -3368,7 +2902,7 @@ "$ref": "#/components/responses/error" } }, - "x-ms-docs-operation-type": "function" + "x-ms-docs-operation-type": "operation" } }, "/NewComePeople/{UserName}/Trips/$ref": { @@ -4198,103 +3732,6 @@ "x-ms-docs-operation-type": "operation" } }, - "/People/{UserName}/Friends/{UserName1}": { - "get": { - "tags": [ - "People.Person" - ], - "summary": "Get Friends from People", - "operationId": "People.GetFriends", - "parameters": [ - { - "name": "UserName", - "in": "path", - "description": "key: UserName of Person", - "required": true, - "schema": { - "type": "string" - }, - "x-ms-docs-key-type": "Person" - }, - { - "name": "UserName1", - "in": "path", - "description": "key: UserName of Person", - "required": true, - "schema": { - "type": "string" - }, - "x-ms-docs-key-type": "Person" - }, - { - "name": "$select", - "in": "query", - "description": "Select properties to be returned", - "style": "form", - "explode": false, - "schema": { - "uniqueItems": true, - "type": "array", - "items": { - "enum": [ - "UserName", - "FirstName", - "LastName", - "MiddleName", - "Gender", - "Age", - "Emails", - "AddressInfo", - "HomeAddress", - "FavoriteFeature", - "Features", - "Friends", - "BestFriend", - "Trips" - ], - "type": "string" - } - } - }, - { - "name": "$expand", - "in": "query", - "description": "Expand related entities", - "style": "form", - "explode": false, - "schema": { - "uniqueItems": true, - "type": "array", - "items": { - "enum": [ - "*", - "Friends", - "BestFriend", - "Trips" - ], - "type": "string" - } - } - } - ], - "responses": { - "200": { - "description": "Retrieved navigation property", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person" - } - } - } - }, - "default": { - "$ref": "#/components/responses/error" - } - }, - "x-ms-docs-operation-type": "operation" - } - }, "/People/{UserName}/Friends/$ref": { "get": { "tags": [ @@ -4839,157 +4276,6 @@ "x-ms-docs-operation-type": "operation" } }, - "/People/{UserName}/Trips/{TripId}": { - "get": { - "tags": [ - "People.Trip" - ], - "summary": "Get Trips from People", - "operationId": "People.GetTrips", - "parameters": [ - { - "name": "UserName", - "in": "path", - "description": "key: UserName of Person", - "required": true, - "schema": { - "type": "string" - }, - "x-ms-docs-key-type": "Person" - }, - { - "name": "TripId", - "in": "path", - "description": "key: TripId of Trip", - "required": true, - "schema": { - "maximum": 2147483647, - "minimum": -2147483648, - "type": "integer", - "format": "int32" - }, - "x-ms-docs-key-type": "Trip" - }, - { - "name": "$select", - "in": "query", - "description": "Select properties to be returned", - "style": "form", - "explode": false, - "schema": { - "uniqueItems": true, - "type": "array", - "items": { - "enum": [ - "TripId", - "ShareId", - "Name", - "Budget", - "Description", - "Tags", - "StartsAt", - "EndsAt", - "PlanItems" - ], - "type": "string" - } - } - }, - { - "name": "$expand", - "in": "query", - "description": "Expand related entities", - "style": "form", - "explode": false, - "schema": { - "uniqueItems": true, - "type": "array", - "items": { - "enum": [ - "*", - "PlanItems" - ], - "type": "string" - } - } - } - ], - "responses": { - "200": { - "description": "Retrieved navigation property", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip" - } - } - } - }, - "default": { - "$ref": "#/components/responses/error" - } - }, - "x-ms-docs-operation-type": "operation" - } - }, - "/People/{UserName}/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()": { - "get": { - "tags": [ - "People.Functions" - ], - "summary": "Invoke function GetInvolvedPeople", - "operationId": "People.Trips.GetInvolvedPeople", - "parameters": [ - { - "name": "UserName", - "in": "path", - "description": "key: UserName of Person", - "required": true, - "schema": { - "type": "string" - }, - "x-ms-docs-key-type": "Person" - }, - { - "name": "TripId", - "in": "path", - "description": "key: TripId of Trip", - "required": true, - "schema": { - "maximum": 2147483647, - "minimum": -2147483648, - "type": "integer", - "format": "int32" - }, - "x-ms-docs-key-type": "Trip" - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person" - } - ], - "nullable": true - } - } - } - } - }, - "default": { - "$ref": "#/components/responses/error" - } - }, - "x-ms-docs-operation-type": "function" - } - }, "/People/{UserName}/Trips/$ref": { "get": { "tags": [ From 3acfa0b23c555b3a5c1b25c2035c5f7fa4e55122 Mon Sep 17 00:00:00 2001 From: Darrel Miller Date: Tue, 25 Aug 2020 10:05:29 -0400 Subject: [PATCH 3/5] Fix tests --- .../Resources/TripService.OData.xml | 2 +- .../Resources/TripService.OpenApi.V2.json | 1626 +++++++---- .../Resources/TripService.OpenApi.V2.yaml | 843 ++++-- .../Resources/TripService.OpenApi.json | 2410 +++++++++++++---- .../Resources/TripService.OpenApi.yaml | 1040 ++++--- 5 files changed, 4279 insertions(+), 1642 deletions(-) diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OData.xml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OData.xml index fc90c82d..adf4ae02 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OData.xml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OData.xml @@ -19,7 +19,7 @@ - + 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..46ef53ec 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 @@ -955,80 +955,6 @@ "x-ms-docs-operation-type": "operation" } }, - "/Me/Friends/{UserName}": { - "get": { - "tags": [ - "Me.Person" - ], - "summary": "Get Friends from Me", - "operationId": "Me.GetFriends", - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "path", - "name": "UserName", - "description": "key: UserName of Person", - "required": true, - "type": "string", - "x-ms-docs-key-type": "Person" - }, - { - "in": "query", - "name": "$select", - "description": "Select properties to be returned", - "type": "array", - "items": { - "enum": [ - "UserName", - "FirstName", - "LastName", - "MiddleName", - "Gender", - "Age", - "Emails", - "AddressInfo", - "HomeAddress", - "FavoriteFeature", - "Features", - "Friends", - "BestFriend", - "Trips" - ], - "type": "string" - } - }, - { - "in": "query", - "name": "$expand", - "description": "Expand related entities", - "type": "array", - "items": { - "enum": [ - "*", - "Friends", - "BestFriend", - "Trips" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Retrieved navigation property", - "schema": { - "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person" - } - }, - "default": { - "$ref": "#/responses/error" - } - }, - "x-ms-docs-operation-type": "operation" - } - }, "/Me/Friends/$ref": { "get": { "tags": [ @@ -1446,6 +1372,42 @@ } }, "x-ms-docs-operation-type": "operation" + }, + "post": { + "tags": [ + "Me.Trip" + ], + "summary": "Create new navigation property to Trips for Me", + "operationId": "Me.CreateTrips", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "description": "New navigation property", + "required": true, + "schema": { + "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip" + } + } + ], + "responses": { + "201": { + "description": "Created navigation property.", + "schema": { + "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip" + } + }, + "default": { + "$ref": "#/responses/error" + } + }, + "x-ms-docs-operation-type": "operation" } }, "/Me/Trips/{TripId}": { @@ -1516,6 +1478,82 @@ } }, "x-ms-docs-operation-type": "operation" + }, + "patch": { + "tags": [ + "Me.Trip" + ], + "summary": "Update the navigation property Trips in Me", + "operationId": "Me.UpdateTrips", + "consumes": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "TripId", + "description": "key: TripId of Trip", + "required": true, + "type": "integer", + "format": "int32", + "maximum": 2147483647, + "minimum": -2147483648, + "x-ms-docs-key-type": "Trip" + }, + { + "in": "body", + "name": "body", + "description": "New navigation property values", + "required": true, + "schema": { + "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip" + } + } + ], + "responses": { + "204": { + "description": "Success" + }, + "default": { + "$ref": "#/responses/error" + } + }, + "x-ms-docs-operation-type": "operation" + }, + "delete": { + "tags": [ + "Me.Trip" + ], + "summary": "Delete navigation property Trips for Me", + "operationId": "Me.DeleteTrips", + "parameters": [ + { + "in": "path", + "name": "TripId", + "description": "key: TripId of Trip", + "required": true, + "type": "integer", + "format": "int32", + "maximum": 2147483647, + "minimum": -2147483648, + "x-ms-docs-key-type": "Trip" + }, + { + "in": "header", + "name": "If-Match", + "description": "ETag", + "type": "string" + } + ], + "responses": { + "204": { + "description": "Success" + }, + "default": { + "$ref": "#/responses/error" + } + }, + "x-ms-docs-operation-type": "operation" } }, "/Me/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()": { @@ -1558,17 +1596,28 @@ "x-ms-docs-operation-type": "function" } }, - "/Me/Trips/$ref": { + "/Me/Trips/{TripId}/PlanItems": { "get": { "tags": [ - "Me.Trip" + "Me.Trips.PlanItem" ], - "summary": "Get ref of Trips from Me", - "operationId": "Me.ListRefTrips", + "summary": "Get PlanItems from Me", + "operationId": "Me.Trips.ListPlanItems", "produces": [ "application/json" ], "parameters": [ + { + "in": "path", + "name": "TripId", + "description": "key: TripId of Trip", + "required": true, + "type": "integer", + "format": "int32", + "maximum": 2147483647, + "minimum": -2147483648, + "x-ms-docs-key-type": "Trip" + }, { "$ref": "#/parameters/top" }, @@ -1591,22 +1640,44 @@ "type": "array", "items": { "enum": [ - "TripId", - "TripId desc", - "ShareId", - "ShareId desc", - "Name", - "Name desc", - "Budget", - "Budget desc", - "Description", - "Description desc", - "Tags", - "Tags desc", + "PlanItemId", + "PlanItemId desc", + "ConfirmationCode", + "ConfirmationCode desc", "StartsAt", "StartsAt desc", "EndsAt", - "EndsAt desc" + "EndsAt desc", + "Duration", + "Duration desc" + ], + "type": "string" + } + }, + { + "in": "query", + "name": "$select", + "description": "Select properties to be returned", + "type": "array", + "items": { + "enum": [ + "PlanItemId", + "ConfirmationCode", + "StartsAt", + "EndsAt", + "Duration" + ], + "type": "string" + } + }, + { + "in": "query", + "name": "$expand", + "description": "Expand related entities", + "type": "array", + "items": { + "enum": [ + "*" ], "type": "string" } @@ -1614,15 +1685,15 @@ ], "responses": { "200": { - "description": "Retrieved navigation property links", + "description": "Retrieved navigation property", "schema": { - "title": "Collection of links of Trip", + "title": "Collection of PlanItem", "type": "object", "properties": { "value": { "type": "array", "items": { - "type": "string" + "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.PlanItem" } } } @@ -1633,38 +1704,131 @@ } }, "x-ms-docs-operation-type": "operation" - }, - "post": { + } + }, + "/Me/Trips/{TripId}/PlanItems/$ref": { + "get": { "tags": [ - "Me.Trip" - ], - "summary": "Create new navigation property ref to Trips for Me", - "operationId": "Me.CreateRefTrips", - "consumes": [ - "application/json" + "Me.Trips.PlanItem" ], + "summary": "Get ref of PlanItems from Me", + "operationId": "Me.Trips.ListRefPlanItems", "produces": [ "application/json" ], "parameters": [ { - "in": "body", - "name": "body", - "description": "New navigation property ref value", + "in": "path", + "name": "TripId", + "description": "key: TripId of Trip", "required": true, - "schema": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - ], - "responses": { - "201": { - "description": "Created navigation property link.", - "schema": { - "type": "object" + "type": "integer", + "format": "int32", + "maximum": 2147483647, + "minimum": -2147483648, + "x-ms-docs-key-type": "Trip" + }, + { + "$ref": "#/parameters/top" + }, + { + "$ref": "#/parameters/skip" + }, + { + "$ref": "#/parameters/search" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/count" + }, + { + "in": "query", + "name": "$orderby", + "description": "Order items by property values", + "type": "array", + "items": { + "enum": [ + "PlanItemId", + "PlanItemId desc", + "ConfirmationCode", + "ConfirmationCode desc", + "StartsAt", + "StartsAt desc", + "EndsAt", + "EndsAt desc", + "Duration", + "Duration desc" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Retrieved navigation property links", + "schema": { + "title": "Collection of links of PlanItem", + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "default": { + "$ref": "#/responses/error" + } + }, + "x-ms-docs-operation-type": "operation" + }, + "post": { + "tags": [ + "Me.Trips.PlanItem" + ], + "summary": "Create new navigation property ref to PlanItems for Me", + "operationId": "Me.Trips.CreateRefPlanItems", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "TripId", + "description": "key: TripId of Trip", + "required": true, + "type": "integer", + "format": "int32", + "maximum": 2147483647, + "minimum": -2147483648, + "x-ms-docs-key-type": "Trip" + }, + { + "in": "body", + "name": "body", + "description": "New navigation property ref value", + "required": true, + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + ], + "responses": { + "201": { + "description": "Created navigation property link.", + "schema": { + "type": "object" } }, "default": { @@ -2288,88 +2452,6 @@ "x-ms-docs-operation-type": "operation" } }, - "/NewComePeople/{UserName}/Friends/{UserName1}": { - "get": { - "tags": [ - "NewComePeople.Person" - ], - "summary": "Get Friends from NewComePeople", - "operationId": "NewComePeople.GetFriends", - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "path", - "name": "UserName", - "description": "key: UserName of Person", - "required": true, - "type": "string", - "x-ms-docs-key-type": "Person" - }, - { - "in": "path", - "name": "UserName1", - "description": "key: UserName of Person", - "required": true, - "type": "string", - "x-ms-docs-key-type": "Person" - }, - { - "in": "query", - "name": "$select", - "description": "Select properties to be returned", - "type": "array", - "items": { - "enum": [ - "UserName", - "FirstName", - "LastName", - "MiddleName", - "Gender", - "Age", - "Emails", - "AddressInfo", - "HomeAddress", - "FavoriteFeature", - "Features", - "Friends", - "BestFriend", - "Trips" - ], - "type": "string" - } - }, - { - "in": "query", - "name": "$expand", - "description": "Expand related entities", - "type": "array", - "items": { - "enum": [ - "*", - "Friends", - "BestFriend", - "Trips" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Retrieved navigation property", - "schema": { - "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person" - } - }, - "default": { - "$ref": "#/responses/error" - } - }, - "x-ms-docs-operation-type": "operation" - } - }, "/NewComePeople/{UserName}/Friends/$ref": { "get": { "tags": [ @@ -2853,6 +2935,50 @@ } }, "x-ms-docs-operation-type": "operation" + }, + "post": { + "tags": [ + "NewComePeople.Trip" + ], + "summary": "Create new navigation property to Trips for NewComePeople", + "operationId": "NewComePeople.CreateTrips", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "UserName", + "description": "key: UserName of Person", + "required": true, + "type": "string", + "x-ms-docs-key-type": "Person" + }, + { + "in": "body", + "name": "body", + "description": "New navigation property", + "required": true, + "schema": { + "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip" + } + } + ], + "responses": { + "201": { + "description": "Created navigation property.", + "schema": { + "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip" + } + }, + "default": { + "$ref": "#/responses/error" + } + }, + "x-ms-docs-operation-type": "operation" } }, "/NewComePeople/{UserName}/Trips/{TripId}": { @@ -2931,16 +3057,14 @@ } }, "x-ms-docs-operation-type": "operation" - } - }, - "/NewComePeople/{UserName}/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()": { - "get": { + }, + "patch": { "tags": [ - "NewComePeople.Functions" + "NewComePeople.Trip" ], - "summary": "Invoke function GetInvolvedPeople", - "operationId": "NewComePeople.Trips.GetInvolvedPeople", - "produces": [ + "summary": "Update the navigation property Trips in NewComePeople", + "operationId": "NewComePeople.UpdateTrips", + "consumes": [ "application/json" ], "parameters": [ @@ -2962,35 +3086,33 @@ "maximum": 2147483647, "minimum": -2147483648, "x-ms-docs-key-type": "Trip" + }, + { + "in": "body", + "name": "body", + "description": "New navigation property values", + "required": true, + "schema": { + "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip" + } } ], "responses": { - "200": { - "description": "Success", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person" - } - } + "204": { + "description": "Success" }, "default": { "$ref": "#/responses/error" } }, - "x-ms-docs-operation-type": "function" - } - }, - "/NewComePeople/{UserName}/Trips/$ref": { - "get": { + "x-ms-docs-operation-type": "operation" + }, + "delete": { "tags": [ "NewComePeople.Trip" ], - "summary": "Get ref of Trips from NewComePeople", - "operationId": "NewComePeople.ListRefTrips", - "produces": [ - "application/json" - ], + "summary": "Delete navigation property Trips for NewComePeople", + "operationId": "NewComePeople.DeleteTrips", "parameters": [ { "in": "path", @@ -3001,7 +3123,114 @@ "x-ms-docs-key-type": "Person" }, { - "$ref": "#/parameters/top" + "in": "path", + "name": "TripId", + "description": "key: TripId of Trip", + "required": true, + "type": "integer", + "format": "int32", + "maximum": 2147483647, + "minimum": -2147483648, + "x-ms-docs-key-type": "Trip" + }, + { + "in": "header", + "name": "If-Match", + "description": "ETag", + "type": "string" + } + ], + "responses": { + "204": { + "description": "Success" + }, + "default": { + "$ref": "#/responses/error" + } + }, + "x-ms-docs-operation-type": "operation" + } + }, + "/NewComePeople/{UserName}/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()": { + "get": { + "tags": [ + "NewComePeople.Functions" + ], + "summary": "Invoke function GetInvolvedPeople", + "operationId": "NewComePeople.Trips.GetInvolvedPeople", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "UserName", + "description": "key: UserName of Person", + "required": true, + "type": "string", + "x-ms-docs-key-type": "Person" + }, + { + "in": "path", + "name": "TripId", + "description": "key: TripId of Trip", + "required": true, + "type": "integer", + "format": "int32", + "maximum": 2147483647, + "minimum": -2147483648, + "x-ms-docs-key-type": "Trip" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person" + } + } + }, + "default": { + "$ref": "#/responses/error" + } + }, + "x-ms-docs-operation-type": "function" + } + }, + "/NewComePeople/{UserName}/Trips/{TripId}/PlanItems": { + "get": { + "tags": [ + "NewComePeople.Trips.PlanItem" + ], + "summary": "Get PlanItems from NewComePeople", + "operationId": "NewComePeople.Trips.ListPlanItems", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "UserName", + "description": "key: UserName of Person", + "required": true, + "type": "string", + "x-ms-docs-key-type": "Person" + }, + { + "in": "path", + "name": "TripId", + "description": "key: TripId of Trip", + "required": true, + "type": "integer", + "format": "int32", + "maximum": 2147483647, + "minimum": -2147483648, + "x-ms-docs-key-type": "Trip" + }, + { + "$ref": "#/parameters/top" }, { "$ref": "#/parameters/skip" @@ -3022,22 +3251,134 @@ "type": "array", "items": { "enum": [ - "TripId", - "TripId desc", - "ShareId", - "ShareId desc", - "Name", - "Name desc", - "Budget", - "Budget desc", - "Description", - "Description desc", - "Tags", - "Tags desc", + "PlanItemId", + "PlanItemId desc", + "ConfirmationCode", + "ConfirmationCode desc", "StartsAt", "StartsAt desc", "EndsAt", - "EndsAt desc" + "EndsAt desc", + "Duration", + "Duration desc" + ], + "type": "string" + } + }, + { + "in": "query", + "name": "$select", + "description": "Select properties to be returned", + "type": "array", + "items": { + "enum": [ + "PlanItemId", + "ConfirmationCode", + "StartsAt", + "EndsAt", + "Duration" + ], + "type": "string" + } + }, + { + "in": "query", + "name": "$expand", + "description": "Expand related entities", + "type": "array", + "items": { + "enum": [ + "*" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Retrieved navigation property", + "schema": { + "title": "Collection of PlanItem", + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.PlanItem" + } + } + } + } + }, + "default": { + "$ref": "#/responses/error" + } + }, + "x-ms-docs-operation-type": "operation" + } + }, + "/NewComePeople/{UserName}/Trips/{TripId}/PlanItems/$ref": { + "get": { + "tags": [ + "NewComePeople.Trips.PlanItem" + ], + "summary": "Get ref of PlanItems from NewComePeople", + "operationId": "NewComePeople.Trips.ListRefPlanItems", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "UserName", + "description": "key: UserName of Person", + "required": true, + "type": "string", + "x-ms-docs-key-type": "Person" + }, + { + "in": "path", + "name": "TripId", + "description": "key: TripId of Trip", + "required": true, + "type": "integer", + "format": "int32", + "maximum": 2147483647, + "minimum": -2147483648, + "x-ms-docs-key-type": "Trip" + }, + { + "$ref": "#/parameters/top" + }, + { + "$ref": "#/parameters/skip" + }, + { + "$ref": "#/parameters/search" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/count" + }, + { + "in": "query", + "name": "$orderby", + "description": "Order items by property values", + "type": "array", + "items": { + "enum": [ + "PlanItemId", + "PlanItemId desc", + "ConfirmationCode", + "ConfirmationCode desc", + "StartsAt", + "StartsAt desc", + "EndsAt", + "EndsAt desc", + "Duration", + "Duration desc" ], "type": "string" } @@ -3047,7 +3388,7 @@ "200": { "description": "Retrieved navigation property links", "schema": { - "title": "Collection of links of Trip", + "title": "Collection of links of PlanItem", "type": "object", "properties": { "value": { @@ -3067,10 +3408,10 @@ }, "post": { "tags": [ - "NewComePeople.Trip" + "NewComePeople.Trips.PlanItem" ], - "summary": "Create new navigation property ref to Trips for NewComePeople", - "operationId": "NewComePeople.CreateRefTrips", + "summary": "Create new navigation property ref to PlanItems for NewComePeople", + "operationId": "NewComePeople.Trips.CreateRefPlanItems", "consumes": [ "application/json" ], @@ -3086,6 +3427,17 @@ "type": "string", "x-ms-docs-key-type": "Person" }, + { + "in": "path", + "name": "TripId", + "description": "key: TripId of Trip", + "required": true, + "type": "integer", + "format": "int32", + "maximum": 2147483647, + "minimum": -2147483648, + "x-ms-docs-key-type": "Trip" + }, { "in": "body", "name": "body", @@ -3727,13 +4079,13 @@ "x-ms-docs-operation-type": "operation" } }, - "/People/{UserName}/Friends/{UserName1}": { + "/People/{UserName}/Friends/$ref": { "get": { "tags": [ "People.Person" ], - "summary": "Get Friends from People", - "operationId": "People.GetFriends", + "summary": "Get ref of Friends from People", + "operationId": "People.ListRefFriends", "produces": [ "application/json" ], @@ -3747,101 +4099,19 @@ "x-ms-docs-key-type": "Person" }, { - "in": "path", - "name": "UserName1", - "description": "key: UserName of Person", - "required": true, - "type": "string", - "x-ms-docs-key-type": "Person" - }, - { - "in": "query", - "name": "$select", - "description": "Select properties to be returned", - "type": "array", - "items": { - "enum": [ - "UserName", - "FirstName", - "LastName", - "MiddleName", - "Gender", - "Age", - "Emails", - "AddressInfo", - "HomeAddress", - "FavoriteFeature", - "Features", - "Friends", - "BestFriend", - "Trips" - ], - "type": "string" - } - }, - { - "in": "query", - "name": "$expand", - "description": "Expand related entities", - "type": "array", - "items": { - "enum": [ - "*", - "Friends", - "BestFriend", - "Trips" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Retrieved navigation property", - "schema": { - "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person" - } - }, - "default": { - "$ref": "#/responses/error" - } - }, - "x-ms-docs-operation-type": "operation" - } - }, - "/People/{UserName}/Friends/$ref": { - "get": { - "tags": [ - "People.Person" - ], - "summary": "Get ref of Friends from People", - "operationId": "People.ListRefFriends", - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "path", - "name": "UserName", - "description": "key: UserName of Person", - "required": true, - "type": "string", - "x-ms-docs-key-type": "Person" - }, - { - "$ref": "#/parameters/top" - }, - { - "$ref": "#/parameters/skip" - }, - { - "$ref": "#/parameters/search" - }, - { - "$ref": "#/parameters/filter" - }, - { - "$ref": "#/parameters/count" + "$ref": "#/parameters/top" + }, + { + "$ref": "#/parameters/skip" + }, + { + "$ref": "#/parameters/search" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/count" }, { "in": "query", @@ -4087,13 +4357,389 @@ "/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.ShareTrip": { "post": { "tags": [ - "People.Actions" - ], - "summary": "Invoke action ShareTrip", - "operationId": "People.ShareTrip", - "consumes": [ - "application/json" + "People.Actions" + ], + "summary": "Invoke action ShareTrip", + "operationId": "People.ShareTrip", + "consumes": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "UserName", + "description": "key: UserName of Person", + "required": true, + "type": "string", + "x-ms-docs-key-type": "Person" + }, + { + "in": "body", + "name": "body", + "description": "Action parameters", + "required": true, + "schema": { + "type": "object", + "properties": { + "userName": { + "type": "string" + }, + "tripId": { + "format": "int32", + "maximum": 2147483647, + "minimum": -2147483648, + "type": "integer" + } + } + } + } + ], + "responses": { + "204": { + "description": "Success" + }, + "default": { + "$ref": "#/responses/error" + } + }, + "x-ms-docs-operation-type": "action" + } + }, + "/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.UpdatePersonLastName(lastName={lastName})": { + "get": { + "tags": [ + "People.Functions" + ], + "summary": "Invoke function UpdatePersonLastName", + "operationId": "People.UpdatePersonLastName", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "UserName", + "description": "key: UserName of Person", + "required": true, + "type": "string", + "x-ms-docs-key-type": "Person" + }, + { + "in": "path", + "name": "lastName", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "default": false, + "type": "boolean" + } + }, + "default": { + "$ref": "#/responses/error" + } + }, + "x-ms-docs-operation-type": "function" + } + }, + "/People/{UserName}/Trips": { + "get": { + "tags": [ + "People.Trip" + ], + "summary": "Get Trips from People", + "operationId": "People.ListTrips", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "UserName", + "description": "key: UserName of Person", + "required": true, + "type": "string", + "x-ms-docs-key-type": "Person" + }, + { + "$ref": "#/parameters/top" + }, + { + "$ref": "#/parameters/skip" + }, + { + "$ref": "#/parameters/search" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/count" + }, + { + "in": "query", + "name": "$orderby", + "description": "Order items by property values", + "type": "array", + "items": { + "enum": [ + "TripId", + "TripId desc", + "ShareId", + "ShareId desc", + "Name", + "Name desc", + "Budget", + "Budget desc", + "Description", + "Description desc", + "Tags", + "Tags desc", + "StartsAt", + "StartsAt desc", + "EndsAt", + "EndsAt desc" + ], + "type": "string" + } + }, + { + "in": "query", + "name": "$select", + "description": "Select properties to be returned", + "type": "array", + "items": { + "enum": [ + "TripId", + "ShareId", + "Name", + "Budget", + "Description", + "Tags", + "StartsAt", + "EndsAt", + "PlanItems" + ], + "type": "string" + } + }, + { + "in": "query", + "name": "$expand", + "description": "Expand related entities", + "type": "array", + "items": { + "enum": [ + "*", + "PlanItems" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Retrieved navigation property", + "schema": { + "title": "Collection of Trip", + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip" + } + } + } + } + }, + "default": { + "$ref": "#/responses/error" + } + }, + "x-ms-docs-operation-type": "operation" + }, + "post": { + "tags": [ + "People.Trip" + ], + "summary": "Create new navigation property to Trips for People", + "operationId": "People.CreateTrips", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "UserName", + "description": "key: UserName of Person", + "required": true, + "type": "string", + "x-ms-docs-key-type": "Person" + }, + { + "in": "body", + "name": "body", + "description": "New navigation property", + "required": true, + "schema": { + "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip" + } + } + ], + "responses": { + "201": { + "description": "Created navigation property.", + "schema": { + "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip" + } + }, + "default": { + "$ref": "#/responses/error" + } + }, + "x-ms-docs-operation-type": "operation" + } + }, + "/People/{UserName}/Trips/{TripId}": { + "get": { + "tags": [ + "People.Trip" + ], + "summary": "Get Trips from People", + "operationId": "People.GetTrips", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "UserName", + "description": "key: UserName of Person", + "required": true, + "type": "string", + "x-ms-docs-key-type": "Person" + }, + { + "in": "path", + "name": "TripId", + "description": "key: TripId of Trip", + "required": true, + "type": "integer", + "format": "int32", + "maximum": 2147483647, + "minimum": -2147483648, + "x-ms-docs-key-type": "Trip" + }, + { + "in": "query", + "name": "$select", + "description": "Select properties to be returned", + "type": "array", + "items": { + "enum": [ + "TripId", + "ShareId", + "Name", + "Budget", + "Description", + "Tags", + "StartsAt", + "EndsAt", + "PlanItems" + ], + "type": "string" + } + }, + { + "in": "query", + "name": "$expand", + "description": "Expand related entities", + "type": "array", + "items": { + "enum": [ + "*", + "PlanItems" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Retrieved navigation property", + "schema": { + "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip" + } + }, + "default": { + "$ref": "#/responses/error" + } + }, + "x-ms-docs-operation-type": "operation" + }, + "patch": { + "tags": [ + "People.Trip" + ], + "summary": "Update the navigation property Trips in People", + "operationId": "People.UpdateTrips", + "consumes": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "UserName", + "description": "key: UserName of Person", + "required": true, + "type": "string", + "x-ms-docs-key-type": "Person" + }, + { + "in": "path", + "name": "TripId", + "description": "key: TripId of Trip", + "required": true, + "type": "integer", + "format": "int32", + "maximum": 2147483647, + "minimum": -2147483648, + "x-ms-docs-key-type": "Trip" + }, + { + "in": "body", + "name": "body", + "description": "New navigation property values", + "required": true, + "schema": { + "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip" + } + } + ], + "responses": { + "204": { + "description": "Success" + }, + "default": { + "$ref": "#/responses/error" + } + }, + "x-ms-docs-operation-type": "operation" + }, + "delete": { + "tags": [ + "People.Trip" ], + "summary": "Delete navigation property Trips for People", + "operationId": "People.DeleteTrips", "parameters": [ { "in": "path", @@ -4104,24 +4750,21 @@ "x-ms-docs-key-type": "Person" }, { - "in": "body", - "name": "body", - "description": "Action parameters", + "in": "path", + "name": "TripId", + "description": "key: TripId of Trip", "required": true, - "schema": { - "type": "object", - "properties": { - "userName": { - "type": "string" - }, - "tripId": { - "format": "int32", - "maximum": 2147483647, - "minimum": -2147483648, - "type": "integer" - } - } - } + "type": "integer", + "format": "int32", + "maximum": 2147483647, + "minimum": -2147483648, + "x-ms-docs-key-type": "Trip" + }, + { + "in": "header", + "name": "If-Match", + "description": "ETag", + "type": "string" } ], "responses": { @@ -4132,16 +4775,16 @@ "$ref": "#/responses/error" } }, - "x-ms-docs-operation-type": "action" + "x-ms-docs-operation-type": "operation" } }, - "/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.UpdatePersonLastName(lastName={lastName})": { + "/People/{UserName}/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()": { "get": { "tags": [ "People.Functions" ], - "summary": "Invoke function UpdatePersonLastName", - "operationId": "People.UpdatePersonLastName", + "summary": "Invoke function GetInvolvedPeople", + "operationId": "People.Trips.GetInvolvedPeople", "produces": [ "application/json" ], @@ -4156,17 +4799,24 @@ }, { "in": "path", - "name": "lastName", + "name": "TripId", + "description": "key: TripId of Trip", "required": true, - "type": "string" + "type": "integer", + "format": "int32", + "maximum": 2147483647, + "minimum": -2147483648, + "x-ms-docs-key-type": "Trip" } ], "responses": { "200": { "description": "Success", "schema": { - "default": false, - "type": "boolean" + "type": "array", + "items": { + "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person" + } } }, "default": { @@ -4176,13 +4826,13 @@ "x-ms-docs-operation-type": "function" } }, - "/People/{UserName}/Trips": { + "/People/{UserName}/Trips/{TripId}/PlanItems": { "get": { "tags": [ - "People.Trip" + "People.Trips.PlanItem" ], - "summary": "Get Trips from People", - "operationId": "People.ListTrips", + "summary": "Get PlanItems from People", + "operationId": "People.Trips.ListPlanItems", "produces": [ "application/json" ], @@ -4195,6 +4845,17 @@ "type": "string", "x-ms-docs-key-type": "Person" }, + { + "in": "path", + "name": "TripId", + "description": "key: TripId of Trip", + "required": true, + "type": "integer", + "format": "int32", + "maximum": 2147483647, + "minimum": -2147483648, + "x-ms-docs-key-type": "Trip" + }, { "$ref": "#/parameters/top" }, @@ -4217,22 +4878,16 @@ "type": "array", "items": { "enum": [ - "TripId", - "TripId desc", - "ShareId", - "ShareId desc", - "Name", - "Name desc", - "Budget", - "Budget desc", - "Description", - "Description desc", - "Tags", - "Tags desc", + "PlanItemId", + "PlanItemId desc", + "ConfirmationCode", + "ConfirmationCode desc", "StartsAt", "StartsAt desc", "EndsAt", - "EndsAt desc" + "EndsAt desc", + "Duration", + "Duration desc" ], "type": "string" } @@ -4244,15 +4899,11 @@ "type": "array", "items": { "enum": [ - "TripId", - "ShareId", - "Name", - "Budget", - "Description", - "Tags", + "PlanItemId", + "ConfirmationCode", "StartsAt", "EndsAt", - "PlanItems" + "Duration" ], "type": "string" } @@ -4264,8 +4915,7 @@ "type": "array", "items": { "enum": [ - "*", - "PlanItems" + "*" ], "type": "string" } @@ -4275,13 +4925,13 @@ "200": { "description": "Retrieved navigation property", "schema": { - "title": "Collection of Trip", + "title": "Collection of PlanItem", "type": "object", "properties": { "value": { "type": "array", "items": { - "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip" + "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.PlanItem" } } } @@ -4294,91 +4944,13 @@ "x-ms-docs-operation-type": "operation" } }, - "/People/{UserName}/Trips/{TripId}": { - "get": { - "tags": [ - "People.Trip" - ], - "summary": "Get Trips from People", - "operationId": "People.GetTrips", - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "path", - "name": "UserName", - "description": "key: UserName of Person", - "required": true, - "type": "string", - "x-ms-docs-key-type": "Person" - }, - { - "in": "path", - "name": "TripId", - "description": "key: TripId of Trip", - "required": true, - "type": "integer", - "format": "int32", - "maximum": 2147483647, - "minimum": -2147483648, - "x-ms-docs-key-type": "Trip" - }, - { - "in": "query", - "name": "$select", - "description": "Select properties to be returned", - "type": "array", - "items": { - "enum": [ - "TripId", - "ShareId", - "Name", - "Budget", - "Description", - "Tags", - "StartsAt", - "EndsAt", - "PlanItems" - ], - "type": "string" - } - }, - { - "in": "query", - "name": "$expand", - "description": "Expand related entities", - "type": "array", - "items": { - "enum": [ - "*", - "PlanItems" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Retrieved navigation property", - "schema": { - "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip" - } - }, - "default": { - "$ref": "#/responses/error" - } - }, - "x-ms-docs-operation-type": "operation" - } - }, - "/People/{UserName}/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()": { + "/People/{UserName}/Trips/{TripId}/PlanItems/$ref": { "get": { "tags": [ - "People.Functions" + "People.Trips.PlanItem" ], - "summary": "Invoke function GetInvolvedPeople", - "operationId": "People.Trips.GetInvolvedPeople", + "summary": "Get ref of PlanItems from People", + "operationId": "People.Trips.ListRefPlanItems", "produces": [ "application/json" ], @@ -4401,43 +4973,6 @@ "maximum": 2147483647, "minimum": -2147483648, "x-ms-docs-key-type": "Trip" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person" - } - } - }, - "default": { - "$ref": "#/responses/error" - } - }, - "x-ms-docs-operation-type": "function" - } - }, - "/People/{UserName}/Trips/$ref": { - "get": { - "tags": [ - "People.Trip" - ], - "summary": "Get ref of Trips from People", - "operationId": "People.ListRefTrips", - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "path", - "name": "UserName", - "description": "key: UserName of Person", - "required": true, - "type": "string", - "x-ms-docs-key-type": "Person" }, { "$ref": "#/parameters/top" @@ -4461,22 +4996,16 @@ "type": "array", "items": { "enum": [ - "TripId", - "TripId desc", - "ShareId", - "ShareId desc", - "Name", - "Name desc", - "Budget", - "Budget desc", - "Description", - "Description desc", - "Tags", - "Tags desc", + "PlanItemId", + "PlanItemId desc", + "ConfirmationCode", + "ConfirmationCode desc", "StartsAt", "StartsAt desc", "EndsAt", - "EndsAt desc" + "EndsAt desc", + "Duration", + "Duration desc" ], "type": "string" } @@ -4486,7 +5015,7 @@ "200": { "description": "Retrieved navigation property links", "schema": { - "title": "Collection of links of Trip", + "title": "Collection of links of PlanItem", "type": "object", "properties": { "value": { @@ -4506,10 +5035,10 @@ }, "post": { "tags": [ - "People.Trip" + "People.Trips.PlanItem" ], - "summary": "Create new navigation property ref to Trips for People", - "operationId": "People.CreateRefTrips", + "summary": "Create new navigation property ref to PlanItems for People", + "operationId": "People.Trips.CreateRefPlanItems", "consumes": [ "application/json" ], @@ -4525,6 +5054,17 @@ "type": "string", "x-ms-docs-key-type": "Person" }, + { + "in": "path", + "name": "TripId", + "description": "key: TripId of Trip", + "required": true, + "type": "integer", + "format": "int32", + "maximum": 2147483647, + "minimum": -2147483648, + "x-ms-docs-key-type": "Trip" + }, { "in": "body", "name": "body", @@ -5250,6 +5790,10 @@ "name": "Me.Trip", "x-ms-docs-toc-type": "page" }, + { + "name": "Me.Trips.PlanItem", + "x-ms-docs-toc-type": "page" + }, { "name": "NewComePeople.Person", "x-ms-docs-toc-type": "page" @@ -5266,6 +5810,10 @@ "name": "NewComePeople.Trip", "x-ms-docs-toc-type": "page" }, + { + "name": "NewComePeople.Trips.PlanItem", + "x-ms-docs-toc-type": "page" + }, { "name": "People.Person", "x-ms-docs-toc-type": "page" @@ -5282,6 +5830,10 @@ "name": "People.Trip", "x-ms-docs-toc-type": "page" }, + { + "name": "People.Trips.PlanItem", + "x-ms-docs-toc-type": "page" + }, { "name": "ResetDataSource", "x-ms-docs-toc-type": "container" 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..1fb3317c 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 @@ -652,61 +652,6 @@ paths: default: $ref: '#/responses/error' x-ms-docs-operation-type: operation - '/Me/Friends/{UserName}': - get: - tags: - - Me.Person - summary: Get Friends from Me - operationId: Me.GetFriends - produces: - - application/json - parameters: - - in: path - name: UserName - description: 'key: UserName of Person' - required: true - type: string - x-ms-docs-key-type: Person - - in: query - name: $select - description: Select properties to be returned - type: array - items: - enum: - - UserName - - FirstName - - LastName - - MiddleName - - Gender - - Age - - Emails - - AddressInfo - - HomeAddress - - FavoriteFeature - - Features - - Friends - - BestFriend - - Trips - type: string - - in: query - name: $expand - description: Expand related entities - type: array - items: - enum: - - '*' - - Friends - - BestFriend - - Trips - type: string - responses: - '200': - description: Retrieved navigation property - schema: - $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person' - default: - $ref: '#/responses/error' - x-ms-docs-operation-type: operation /Me/Friends/$ref: get: tags: @@ -991,6 +936,30 @@ paths: default: $ref: '#/responses/error' x-ms-docs-operation-type: operation + post: + tags: + - Me.Trip + summary: Create new navigation property to Trips for Me + operationId: Me.CreateTrips + consumes: + - application/json + produces: + - application/json + parameters: + - in: body + name: body + description: New navigation property + required: true + schema: + $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip' + responses: + '201': + description: Created navigation property. + schema: + $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip' + default: + $ref: '#/responses/error' + x-ms-docs-operation-type: operation '/Me/Trips/{TripId}': get: tags: @@ -1042,6 +1011,60 @@ paths: default: $ref: '#/responses/error' x-ms-docs-operation-type: operation + patch: + tags: + - Me.Trip + summary: Update the navigation property Trips in Me + operationId: Me.UpdateTrips + consumes: + - application/json + parameters: + - in: path + name: TripId + description: 'key: TripId of Trip' + required: true + type: integer + format: int32 + maximum: 2147483647 + minimum: -2147483648 + x-ms-docs-key-type: Trip + - in: body + name: body + description: New navigation property values + required: true + schema: + $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip' + responses: + '204': + description: Success + default: + $ref: '#/responses/error' + x-ms-docs-operation-type: operation + delete: + tags: + - Me.Trip + summary: Delete navigation property Trips for Me + operationId: Me.DeleteTrips + parameters: + - in: path + name: TripId + description: 'key: TripId of Trip' + required: true + type: integer + format: int32 + maximum: 2147483647 + minimum: -2147483648 + x-ms-docs-key-type: Trip + - in: header + name: If-Match + description: ETag + type: string + responses: + '204': + description: Success + default: + $ref: '#/responses/error' + x-ms-docs-operation-type: operation '/Me/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()': get: tags: @@ -1070,15 +1093,24 @@ paths: default: $ref: '#/responses/error' x-ms-docs-operation-type: function - /Me/Trips/$ref: + '/Me/Trips/{TripId}/PlanItems': get: tags: - - Me.Trip - summary: Get ref of Trips from Me - operationId: Me.ListRefTrips + - Me.Trips.PlanItem + summary: Get PlanItems from Me + operationId: Me.Trips.ListPlanItems produces: - application/json parameters: + - in: path + name: TripId + description: 'key: TripId of Trip' + required: true + type: integer + format: int32 + maximum: 2147483647 + minimum: -2147483648 + x-ms-docs-key-type: Trip - $ref: '#/parameters/top' - $ref: '#/parameters/skip' - $ref: '#/parameters/search' @@ -1090,28 +1122,96 @@ paths: type: array items: enum: - - TripId - - TripId desc - - ShareId - - ShareId desc - - Name - - Name desc - - Budget - - Budget desc - - Description - - Description desc - - Tags - - Tags desc + - PlanItemId + - PlanItemId desc + - ConfirmationCode + - ConfirmationCode desc - StartsAt - StartsAt desc - EndsAt - EndsAt desc + - Duration + - Duration desc + type: string + - in: query + name: $select + description: Select properties to be returned + type: array + items: + enum: + - PlanItemId + - ConfirmationCode + - StartsAt + - EndsAt + - Duration + type: string + - in: query + name: $expand + description: Expand related entities + type: array + items: + enum: + - '*' + type: string + responses: + '200': + description: Retrieved navigation property + schema: + title: Collection of PlanItem + type: object + properties: + value: + type: array + items: + $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.PlanItem' + default: + $ref: '#/responses/error' + x-ms-docs-operation-type: operation + '/Me/Trips/{TripId}/PlanItems/$ref': + get: + tags: + - Me.Trips.PlanItem + summary: Get ref of PlanItems from Me + operationId: Me.Trips.ListRefPlanItems + produces: + - application/json + parameters: + - in: path + name: TripId + description: 'key: TripId of Trip' + required: true + type: integer + format: int32 + maximum: 2147483647 + minimum: -2147483648 + x-ms-docs-key-type: Trip + - $ref: '#/parameters/top' + - $ref: '#/parameters/skip' + - $ref: '#/parameters/search' + - $ref: '#/parameters/filter' + - $ref: '#/parameters/count' + - in: query + name: $orderby + description: Order items by property values + type: array + items: + enum: + - PlanItemId + - PlanItemId desc + - ConfirmationCode + - ConfirmationCode desc + - StartsAt + - StartsAt desc + - EndsAt + - EndsAt desc + - Duration + - Duration desc type: string responses: '200': description: Retrieved navigation property links schema: - title: Collection of links of Trip + title: Collection of links of PlanItem type: object properties: value: @@ -1123,14 +1223,23 @@ paths: x-ms-docs-operation-type: operation post: tags: - - Me.Trip - summary: Create new navigation property ref to Trips for Me - operationId: Me.CreateRefTrips + - Me.Trips.PlanItem + summary: Create new navigation property ref to PlanItems for Me + operationId: Me.Trips.CreateRefPlanItems consumes: - application/json produces: - application/json parameters: + - in: path + name: TripId + description: 'key: TripId of Trip' + required: true + type: integer + format: int32 + maximum: 2147483647 + minimum: -2147483648 + x-ms-docs-key-type: Trip - in: body name: body description: New navigation property ref value @@ -1585,67 +1694,6 @@ paths: default: $ref: '#/responses/error' x-ms-docs-operation-type: operation - '/NewComePeople/{UserName}/Friends/{UserName1}': - get: - tags: - - NewComePeople.Person - summary: Get Friends from NewComePeople - operationId: NewComePeople.GetFriends - produces: - - application/json - parameters: - - in: path - name: UserName - description: 'key: UserName of Person' - required: true - type: string - x-ms-docs-key-type: Person - - in: path - name: UserName1 - description: 'key: UserName of Person' - required: true - type: string - x-ms-docs-key-type: Person - - in: query - name: $select - description: Select properties to be returned - type: array - items: - enum: - - UserName - - FirstName - - LastName - - MiddleName - - Gender - - Age - - Emails - - AddressInfo - - HomeAddress - - FavoriteFeature - - Features - - Friends - - BestFriend - - Trips - type: string - - in: query - name: $expand - description: Expand related entities - type: array - items: - enum: - - '*' - - Friends - - BestFriend - - Trips - type: string - responses: - '200': - description: Retrieved navigation property - schema: - $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person' - default: - $ref: '#/responses/error' - x-ms-docs-operation-type: operation '/NewComePeople/{UserName}/Friends/$ref': get: tags: @@ -1979,6 +2027,36 @@ paths: default: $ref: '#/responses/error' x-ms-docs-operation-type: operation + post: + tags: + - NewComePeople.Trip + summary: Create new navigation property to Trips for NewComePeople + operationId: NewComePeople.CreateTrips + consumes: + - application/json + produces: + - application/json + parameters: + - in: path + name: UserName + description: 'key: UserName of Person' + required: true + type: string + x-ms-docs-key-type: Person + - in: body + name: body + description: New navigation property + required: true + schema: + $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip' + responses: + '201': + description: Created navigation property. + schema: + $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip' + default: + $ref: '#/responses/error' + x-ms-docs-operation-type: operation '/NewComePeople/{UserName}/Trips/{TripId}': get: tags: @@ -2036,6 +2114,72 @@ paths: default: $ref: '#/responses/error' x-ms-docs-operation-type: operation + patch: + tags: + - NewComePeople.Trip + summary: Update the navigation property Trips in NewComePeople + operationId: NewComePeople.UpdateTrips + consumes: + - application/json + parameters: + - in: path + name: UserName + description: 'key: UserName of Person' + required: true + type: string + x-ms-docs-key-type: Person + - in: path + name: TripId + description: 'key: TripId of Trip' + required: true + type: integer + format: int32 + maximum: 2147483647 + minimum: -2147483648 + x-ms-docs-key-type: Trip + - in: body + name: body + description: New navigation property values + required: true + schema: + $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip' + responses: + '204': + description: Success + default: + $ref: '#/responses/error' + x-ms-docs-operation-type: operation + delete: + tags: + - NewComePeople.Trip + summary: Delete navigation property Trips for NewComePeople + operationId: NewComePeople.DeleteTrips + parameters: + - in: path + name: UserName + description: 'key: UserName of Person' + required: true + type: string + x-ms-docs-key-type: Person + - in: path + name: TripId + description: 'key: TripId of Trip' + required: true + type: integer + format: int32 + maximum: 2147483647 + minimum: -2147483648 + x-ms-docs-key-type: Trip + - in: header + name: If-Match + description: ETag + type: string + responses: + '204': + description: Success + default: + $ref: '#/responses/error' + x-ms-docs-operation-type: operation '/NewComePeople/{UserName}/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()': get: tags: @@ -2070,12 +2214,12 @@ paths: default: $ref: '#/responses/error' x-ms-docs-operation-type: function - '/NewComePeople/{UserName}/Trips/$ref': + '/NewComePeople/{UserName}/Trips/{TripId}/PlanItems': get: tags: - - NewComePeople.Trip - summary: Get ref of Trips from NewComePeople - operationId: NewComePeople.ListRefTrips + - NewComePeople.Trips.PlanItem + summary: Get PlanItems from NewComePeople + operationId: NewComePeople.Trips.ListPlanItems produces: - application/json parameters: @@ -2085,6 +2229,15 @@ paths: required: true type: string x-ms-docs-key-type: Person + - in: path + name: TripId + description: 'key: TripId of Trip' + required: true + type: integer + format: int32 + maximum: 2147483647 + minimum: -2147483648 + x-ms-docs-key-type: Trip - $ref: '#/parameters/top' - $ref: '#/parameters/skip' - $ref: '#/parameters/search' @@ -2096,28 +2249,102 @@ paths: type: array items: enum: - - TripId - - TripId desc - - ShareId - - ShareId desc - - Name - - Name desc - - Budget - - Budget desc - - Description - - Description desc - - Tags - - Tags desc + - PlanItemId + - PlanItemId desc + - ConfirmationCode + - ConfirmationCode desc + - StartsAt + - StartsAt desc + - EndsAt + - EndsAt desc + - Duration + - Duration desc + type: string + - in: query + name: $select + description: Select properties to be returned + type: array + items: + enum: + - PlanItemId + - ConfirmationCode + - StartsAt + - EndsAt + - Duration + type: string + - in: query + name: $expand + description: Expand related entities + type: array + items: + enum: + - '*' + type: string + responses: + '200': + description: Retrieved navigation property + schema: + title: Collection of PlanItem + type: object + properties: + value: + type: array + items: + $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.PlanItem' + default: + $ref: '#/responses/error' + x-ms-docs-operation-type: operation + '/NewComePeople/{UserName}/Trips/{TripId}/PlanItems/$ref': + get: + tags: + - NewComePeople.Trips.PlanItem + summary: Get ref of PlanItems from NewComePeople + operationId: NewComePeople.Trips.ListRefPlanItems + produces: + - application/json + parameters: + - in: path + name: UserName + description: 'key: UserName of Person' + required: true + type: string + x-ms-docs-key-type: Person + - in: path + name: TripId + description: 'key: TripId of Trip' + required: true + type: integer + format: int32 + maximum: 2147483647 + minimum: -2147483648 + x-ms-docs-key-type: Trip + - $ref: '#/parameters/top' + - $ref: '#/parameters/skip' + - $ref: '#/parameters/search' + - $ref: '#/parameters/filter' + - $ref: '#/parameters/count' + - in: query + name: $orderby + description: Order items by property values + type: array + items: + enum: + - PlanItemId + - PlanItemId desc + - ConfirmationCode + - ConfirmationCode desc - StartsAt - StartsAt desc - EndsAt - EndsAt desc + - Duration + - Duration desc type: string responses: '200': description: Retrieved navigation property links schema: - title: Collection of links of Trip + title: Collection of links of PlanItem type: object properties: value: @@ -2129,9 +2356,9 @@ paths: x-ms-docs-operation-type: operation post: tags: - - NewComePeople.Trip - summary: Create new navigation property ref to Trips for NewComePeople - operationId: NewComePeople.CreateRefTrips + - NewComePeople.Trips.PlanItem + summary: Create new navigation property ref to PlanItems for NewComePeople + operationId: NewComePeople.Trips.CreateRefPlanItems consumes: - application/json produces: @@ -2143,6 +2370,15 @@ paths: required: true type: string x-ms-docs-key-type: Person + - in: path + name: TripId + description: 'key: TripId of Trip' + required: true + type: integer + format: int32 + maximum: 2147483647 + minimum: -2147483648 + x-ms-docs-key-type: Trip - in: body name: body description: New navigation property ref value @@ -2597,67 +2833,6 @@ paths: default: $ref: '#/responses/error' x-ms-docs-operation-type: operation - '/People/{UserName}/Friends/{UserName1}': - get: - tags: - - People.Person - summary: Get Friends from People - operationId: People.GetFriends - produces: - - application/json - parameters: - - in: path - name: UserName - description: 'key: UserName of Person' - required: true - type: string - x-ms-docs-key-type: Person - - in: path - name: UserName1 - description: 'key: UserName of Person' - required: true - type: string - x-ms-docs-key-type: Person - - in: query - name: $select - description: Select properties to be returned - type: array - items: - enum: - - UserName - - FirstName - - LastName - - MiddleName - - Gender - - Age - - Emails - - AddressInfo - - HomeAddress - - FavoriteFeature - - Features - - Friends - - BestFriend - - Trips - type: string - - in: query - name: $expand - description: Expand related entities - type: array - items: - enum: - - '*' - - Friends - - BestFriend - - Trips - type: string - responses: - '200': - description: Retrieved navigation property - schema: - $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person' - default: - $ref: '#/responses/error' - x-ms-docs-operation-type: operation '/People/{UserName}/Friends/$ref': get: tags: @@ -2991,6 +3166,36 @@ paths: default: $ref: '#/responses/error' x-ms-docs-operation-type: operation + post: + tags: + - People.Trip + summary: Create new navigation property to Trips for People + operationId: People.CreateTrips + consumes: + - application/json + produces: + - application/json + parameters: + - in: path + name: UserName + description: 'key: UserName of Person' + required: true + type: string + x-ms-docs-key-type: Person + - in: body + name: body + description: New navigation property + required: true + schema: + $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip' + responses: + '201': + description: Created navigation property. + schema: + $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip' + default: + $ref: '#/responses/error' + x-ms-docs-operation-type: operation '/People/{UserName}/Trips/{TripId}': get: tags: @@ -3048,6 +3253,72 @@ paths: default: $ref: '#/responses/error' x-ms-docs-operation-type: operation + patch: + tags: + - People.Trip + summary: Update the navigation property Trips in People + operationId: People.UpdateTrips + consumes: + - application/json + parameters: + - in: path + name: UserName + description: 'key: UserName of Person' + required: true + type: string + x-ms-docs-key-type: Person + - in: path + name: TripId + description: 'key: TripId of Trip' + required: true + type: integer + format: int32 + maximum: 2147483647 + minimum: -2147483648 + x-ms-docs-key-type: Trip + - in: body + name: body + description: New navigation property values + required: true + schema: + $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip' + responses: + '204': + description: Success + default: + $ref: '#/responses/error' + x-ms-docs-operation-type: operation + delete: + tags: + - People.Trip + summary: Delete navigation property Trips for People + operationId: People.DeleteTrips + parameters: + - in: path + name: UserName + description: 'key: UserName of Person' + required: true + type: string + x-ms-docs-key-type: Person + - in: path + name: TripId + description: 'key: TripId of Trip' + required: true + type: integer + format: int32 + maximum: 2147483647 + minimum: -2147483648 + x-ms-docs-key-type: Trip + - in: header + name: If-Match + description: ETag + type: string + responses: + '204': + description: Success + default: + $ref: '#/responses/error' + x-ms-docs-operation-type: operation '/People/{UserName}/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()': get: tags: @@ -3082,12 +3353,12 @@ paths: default: $ref: '#/responses/error' x-ms-docs-operation-type: function - '/People/{UserName}/Trips/$ref': + '/People/{UserName}/Trips/{TripId}/PlanItems': get: tags: - - People.Trip - summary: Get ref of Trips from People - operationId: People.ListRefTrips + - People.Trips.PlanItem + summary: Get PlanItems from People + operationId: People.Trips.ListPlanItems produces: - application/json parameters: @@ -3097,6 +3368,15 @@ paths: required: true type: string x-ms-docs-key-type: Person + - in: path + name: TripId + description: 'key: TripId of Trip' + required: true + type: integer + format: int32 + maximum: 2147483647 + minimum: -2147483648 + x-ms-docs-key-type: Trip - $ref: '#/parameters/top' - $ref: '#/parameters/skip' - $ref: '#/parameters/search' @@ -3108,28 +3388,102 @@ paths: type: array items: enum: - - TripId - - TripId desc - - ShareId - - ShareId desc - - Name - - Name desc - - Budget - - Budget desc - - Description - - Description desc - - Tags - - Tags desc + - PlanItemId + - PlanItemId desc + - ConfirmationCode + - ConfirmationCode desc + - StartsAt + - StartsAt desc + - EndsAt + - EndsAt desc + - Duration + - Duration desc + type: string + - in: query + name: $select + description: Select properties to be returned + type: array + items: + enum: + - PlanItemId + - ConfirmationCode + - StartsAt + - EndsAt + - Duration + type: string + - in: query + name: $expand + description: Expand related entities + type: array + items: + enum: + - '*' + type: string + responses: + '200': + description: Retrieved navigation property + schema: + title: Collection of PlanItem + type: object + properties: + value: + type: array + items: + $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.PlanItem' + default: + $ref: '#/responses/error' + x-ms-docs-operation-type: operation + '/People/{UserName}/Trips/{TripId}/PlanItems/$ref': + get: + tags: + - People.Trips.PlanItem + summary: Get ref of PlanItems from People + operationId: People.Trips.ListRefPlanItems + produces: + - application/json + parameters: + - in: path + name: UserName + description: 'key: UserName of Person' + required: true + type: string + x-ms-docs-key-type: Person + - in: path + name: TripId + description: 'key: TripId of Trip' + required: true + type: integer + format: int32 + maximum: 2147483647 + minimum: -2147483648 + x-ms-docs-key-type: Trip + - $ref: '#/parameters/top' + - $ref: '#/parameters/skip' + - $ref: '#/parameters/search' + - $ref: '#/parameters/filter' + - $ref: '#/parameters/count' + - in: query + name: $orderby + description: Order items by property values + type: array + items: + enum: + - PlanItemId + - PlanItemId desc + - ConfirmationCode + - ConfirmationCode desc - StartsAt - StartsAt desc - EndsAt - EndsAt desc + - Duration + - Duration desc type: string responses: '200': description: Retrieved navigation property links schema: - title: Collection of links of Trip + title: Collection of links of PlanItem type: object properties: value: @@ -3141,9 +3495,9 @@ paths: x-ms-docs-operation-type: operation post: tags: - - People.Trip - summary: Create new navigation property ref to Trips for People - operationId: People.CreateRefTrips + - People.Trips.PlanItem + summary: Create new navigation property ref to PlanItems for People + operationId: People.Trips.CreateRefPlanItems consumes: - application/json produces: @@ -3155,6 +3509,15 @@ paths: required: true type: string x-ms-docs-key-type: Person + - in: path + name: TripId + description: 'key: TripId of Trip' + required: true + type: integer + format: int32 + maximum: 2147483647 + minimum: -2147483648 + x-ms-docs-key-type: Trip - in: body name: body description: New navigation property ref value @@ -3625,6 +3988,8 @@ tags: x-ms-docs-toc-type: container - name: Me.Trip x-ms-docs-toc-type: page + - name: Me.Trips.PlanItem + x-ms-docs-toc-type: page - name: NewComePeople.Person x-ms-docs-toc-type: page - name: NewComePeople.Functions @@ -3633,6 +3998,8 @@ tags: x-ms-docs-toc-type: container - name: NewComePeople.Trip x-ms-docs-toc-type: page + - name: NewComePeople.Trips.PlanItem + x-ms-docs-toc-type: page - name: People.Person x-ms-docs-toc-type: page - name: People.Functions @@ -3641,5 +4008,7 @@ tags: x-ms-docs-toc-type: container - name: People.Trip x-ms-docs-toc-type: page + - name: People.Trips.PlanItem + x-ms-docs-toc-type: page - name: ResetDataSource 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 5ab87485..9a316bc2 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json @@ -1554,35 +1554,67 @@ } }, "x-ms-docs-operation-type": "operation" + }, + "post": { + "tags": [ + "Me.Trip" + ], + "summary": "Create new navigation property to Trips for Me", + "operationId": "Me.CreateTrips", + "requestBody": { + "description": "New navigation property", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Created navigation property.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip" + } + } + } + }, + "default": { + "$ref": "#/components/responses/error" + } + }, + "x-ms-docs-operation-type": "operation" } }, - "/Me/Trips/$ref": { + "/Me/Trips/{TripId}": { "get": { "tags": [ "Me.Trip" ], - "summary": "Get ref of Trips from Me", - "operationId": "Me.ListRefTrips", + "summary": "Get Trips from Me", + "operationId": "Me.GetTrips", "parameters": [ { - "$ref": "#/components/parameters/top" - }, - { - "$ref": "#/components/parameters/skip" - }, - { - "$ref": "#/components/parameters/search" - }, - { - "$ref": "#/components/parameters/filter" - }, - { - "$ref": "#/components/parameters/count" + "name": "TripId", + "in": "path", + "description": "key: TripId of Trip", + "required": true, + "schema": { + "maximum": 2147483647, + "minimum": -2147483648, + "type": "integer", + "format": "int32" + }, + "x-ms-docs-key-type": "Trip" }, { - "name": "$orderby", + "name": "$select", "in": "query", - "description": "Order items by property values", + "description": "Select properties to be returned", "style": "form", "explode": false, "schema": { @@ -1591,21 +1623,32 @@ "items": { "enum": [ "TripId", - "TripId desc", "ShareId", - "ShareId desc", "Name", - "Name desc", "Budget", - "Budget desc", "Description", - "Description desc", "Tags", - "Tags desc", "StartsAt", - "StartsAt desc", "EndsAt", - "EndsAt desc" + "PlanItems" + ], + "type": "string" + } + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities", + "style": "form", + "explode": false, + "schema": { + "uniqueItems": true, + "type": "array", + "items": { + "enum": [ + "*", + "PlanItems" ], "type": "string" } @@ -1614,20 +1657,11 @@ ], "responses": { "200": { - "description": "Retrieved navigation property links", + "description": "Retrieved navigation property", "content": { "application/json": { "schema": { - "title": "Collection of links of Trip", - "type": "object", - "properties": { - "value": { - "type": "array", - "items": { - "type": "string" - } - } - } + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip" } } } @@ -1638,33 +1672,125 @@ }, "x-ms-docs-operation-type": "operation" }, - "post": { + "patch": { "tags": [ "Me.Trip" ], - "summary": "Create new navigation property ref to Trips for Me", - "operationId": "Me.CreateRefTrips", + "summary": "Update the navigation property Trips in Me", + "operationId": "Me.UpdateTrips", + "parameters": [ + { + "name": "TripId", + "in": "path", + "description": "key: TripId of Trip", + "required": true, + "schema": { + "maximum": 2147483647, + "minimum": -2147483648, + "type": "integer", + "format": "int32" + }, + "x-ms-docs-key-type": "Trip" + } + ], "requestBody": { - "description": "New navigation property ref value", + "description": "New navigation property values", "content": { "application/json": { "schema": { - "type": "object", - "additionalProperties": { - "type": "object" - } + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip" } } }, "required": true }, "responses": { - "201": { - "description": "Created navigation property link.", + "204": { + "description": "Success" + }, + "default": { + "$ref": "#/components/responses/error" + } + }, + "x-ms-docs-operation-type": "operation" + }, + "delete": { + "tags": [ + "Me.Trip" + ], + "summary": "Delete navigation property Trips for Me", + "operationId": "Me.DeleteTrips", + "parameters": [ + { + "name": "TripId", + "in": "path", + "description": "key: TripId of Trip", + "required": true, + "schema": { + "maximum": 2147483647, + "minimum": -2147483648, + "type": "integer", + "format": "int32" + }, + "x-ms-docs-key-type": "Trip" + }, + { + "name": "If-Match", + "in": "header", + "description": "ETag", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Success" + }, + "default": { + "$ref": "#/components/responses/error" + } + }, + "x-ms-docs-operation-type": "operation" + } + }, + "/Me/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()": { + "get": { + "tags": [ + "Me.Functions" + ], + "summary": "Invoke function GetInvolvedPeople", + "operationId": "Me.Trips.GetInvolvedPeople", + "parameters": [ + { + "name": "TripId", + "in": "path", + "description": "key: TripId of Trip", + "required": true, + "schema": { + "maximum": 2147483647, + "minimum": -2147483648, + "type": "integer", + "format": "int32" + }, + "x-ms-docs-key-type": "Trip" + } + ], + "responses": { + "200": { + "description": "Success", "content": { "application/json": { "schema": { - "type": "object" + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person" + } + ], + "nullable": true + } } } } @@ -1673,17 +1799,30 @@ "$ref": "#/components/responses/error" } }, - "x-ms-docs-operation-type": "operation" + "x-ms-docs-operation-type": "function" } }, - "/NewComePeople": { + "/Me/Trips/{TripId}/PlanItems": { "get": { "tags": [ - "NewComePeople.Person" + "Me.Trips.PlanItem" ], - "summary": "Get entities from NewComePeople", - "operationId": "NewComePeople.Person.ListPerson", + "summary": "Get PlanItems from Me", + "operationId": "Me.Trips.ListPlanItems", "parameters": [ + { + "name": "TripId", + "in": "path", + "description": "key: TripId of Trip", + "required": true, + "schema": { + "maximum": 2147483647, + "minimum": -2147483648, + "type": "integer", + "format": "int32" + }, + "x-ms-docs-key-type": "Trip" + }, { "$ref": "#/components/parameters/top" }, @@ -1710,28 +1849,16 @@ "type": "array", "items": { "enum": [ - "UserName", - "UserName desc", - "FirstName", - "FirstName desc", - "LastName", - "LastName desc", - "MiddleName", - "MiddleName desc", - "Gender", - "Gender desc", - "Age", - "Age desc", - "Emails", - "Emails desc", - "AddressInfo", - "AddressInfo desc", - "HomeAddress", - "HomeAddress desc", - "FavoriteFeature", - "FavoriteFeature desc", - "Features", - "Features desc" + "PlanItemId", + "PlanItemId desc", + "ConfirmationCode", + "ConfirmationCode desc", + "StartsAt", + "StartsAt desc", + "EndsAt", + "EndsAt desc", + "Duration", + "Duration desc" ], "type": "string" } @@ -1748,20 +1875,11 @@ "type": "array", "items": { "enum": [ - "UserName", - "FirstName", - "LastName", - "MiddleName", - "Gender", - "Age", - "Emails", - "AddressInfo", - "HomeAddress", - "FavoriteFeature", - "Features", - "Friends", - "BestFriend", - "Trips" + "PlanItemId", + "ConfirmationCode", + "StartsAt", + "EndsAt", + "Duration" ], "type": "string" } @@ -1778,10 +1896,7 @@ "type": "array", "items": { "enum": [ - "*", - "Friends", - "BestFriend", - "Trips" + "*" ], "type": "string" } @@ -1790,17 +1905,17 @@ ], "responses": { "200": { - "description": "Retrieved entities", + "description": "Retrieved navigation property", "content": { "application/json": { "schema": { - "title": "Collection of Person", + "title": "Collection of PlanItem", "type": "object", "properties": { "value": { "type": "array", "items": { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person" + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.PlanItem" } } } @@ -1811,32 +1926,141 @@ "default": { "$ref": "#/components/responses/error" } - } - }, - "post": { + }, + "x-ms-docs-operation-type": "operation" + } + }, + "/Me/Trips/{TripId}/PlanItems/$ref": { + "get": { "tags": [ - "NewComePeople.Person" + "Me.Trips.PlanItem" ], - "summary": "Add new entity to NewComePeople", - "operationId": "NewComePeople.Person.CreatePerson", - "requestBody": { - "description": "New entity", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person" - } - } - }, - "required": true - }, - "responses": { - "201": { - "description": "Created entity", + "summary": "Get ref of PlanItems from Me", + "operationId": "Me.Trips.ListRefPlanItems", + "parameters": [ + { + "name": "TripId", + "in": "path", + "description": "key: TripId of Trip", + "required": true, + "schema": { + "maximum": 2147483647, + "minimum": -2147483648, + "type": "integer", + "format": "int32" + }, + "x-ms-docs-key-type": "Trip" + }, + { + "$ref": "#/components/parameters/top" + }, + { + "$ref": "#/components/parameters/skip" + }, + { + "$ref": "#/components/parameters/search" + }, + { + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/count" + }, + { + "name": "$orderby", + "in": "query", + "description": "Order items by property values", + "style": "form", + "explode": false, + "schema": { + "uniqueItems": true, + "type": "array", + "items": { + "enum": [ + "PlanItemId", + "PlanItemId desc", + "ConfirmationCode", + "ConfirmationCode desc", + "StartsAt", + "StartsAt desc", + "EndsAt", + "EndsAt desc", + "Duration", + "Duration desc" + ], + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved navigation property links", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person" + "title": "Collection of links of PlanItem", + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + }, + "default": { + "$ref": "#/components/responses/error" + } + }, + "x-ms-docs-operation-type": "operation" + }, + "post": { + "tags": [ + "Me.Trips.PlanItem" + ], + "summary": "Create new navigation property ref to PlanItems for Me", + "operationId": "Me.Trips.CreateRefPlanItems", + "parameters": [ + { + "name": "TripId", + "in": "path", + "description": "key: TripId of Trip", + "required": true, + "schema": { + "maximum": 2147483647, + "minimum": -2147483648, + "type": "integer", + "format": "int32" + }, + "x-ms-docs-key-type": "Trip" + } + ], + "requestBody": { + "description": "New navigation property ref value", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Created navigation property link.", + "content": { + "application/json": { + "schema": { + "type": "object" } } } @@ -1848,23 +2072,66 @@ "x-ms-docs-operation-type": "operation" } }, - "/NewComePeople/{UserName}": { + "/NewComePeople": { "get": { "tags": [ "NewComePeople.Person" ], - "summary": "Get entity from NewComePeople by key", - "operationId": "NewComePeople.Person.GetPerson", + "summary": "Get entities from NewComePeople", + "operationId": "NewComePeople.Person.ListPerson", "parameters": [ { - "name": "UserName", - "in": "path", - "description": "key: UserName of Person", - "required": true, + "$ref": "#/components/parameters/top" + }, + { + "$ref": "#/components/parameters/skip" + }, + { + "$ref": "#/components/parameters/search" + }, + { + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/count" + }, + { + "name": "$orderby", + "in": "query", + "description": "Order items by property values", + "style": "form", + "explode": false, "schema": { - "type": "string" - }, - "x-ms-docs-key-type": "Person" + "uniqueItems": true, + "type": "array", + "items": { + "enum": [ + "UserName", + "UserName desc", + "FirstName", + "FirstName desc", + "LastName", + "LastName desc", + "MiddleName", + "MiddleName desc", + "Gender", + "Gender desc", + "Age", + "Age desc", + "Emails", + "Emails desc", + "AddressInfo", + "AddressInfo desc", + "HomeAddress", + "HomeAddress desc", + "FavoriteFeature", + "FavoriteFeature desc", + "Features", + "Features desc" + ], + "type": "string" + } + } }, { "name": "$select", @@ -1919,11 +2186,20 @@ ], "responses": { "200": { - "description": "Retrieved entity", + "description": "Retrieved entities", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person" + "title": "Collection of Person", + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person" + } + } + } } } } @@ -1931,29 +2207,16 @@ "default": { "$ref": "#/components/responses/error" } - }, - "x-ms-docs-operation-type": "operation" + } }, - "patch": { + "post": { "tags": [ "NewComePeople.Person" ], - "summary": "Update entity in NewComePeople", - "operationId": "NewComePeople.Person.UpdatePerson", - "parameters": [ - { - "name": "UserName", - "in": "path", - "description": "key: UserName of Person", - "required": true, - "schema": { - "type": "string" - }, - "x-ms-docs-key-type": "Person" - } - ], + "summary": "Add new entity to NewComePeople", + "operationId": "NewComePeople.Person.CreatePerson", "requestBody": { - "description": "New property values", + "description": "New entity", "content": { "application/json": { "schema": { @@ -1964,44 +2227,15 @@ "required": true }, "responses": { - "204": { - "description": "Success" - }, - "default": { - "$ref": "#/components/responses/error" - } - }, - "x-ms-docs-operation-type": "operation" - }, - "delete": { - "tags": [ - "NewComePeople.Person" - ], - "summary": "Delete entity from NewComePeople", - "operationId": "NewComePeople.Person.DeletePerson", - "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" + "201": { + "description": "Created entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person" + } + } } - } - ], - "responses": { - "204": { - "description": "Success" }, "default": { "$ref": "#/components/responses/error" @@ -2010,13 +2244,13 @@ "x-ms-docs-operation-type": "operation" } }, - "/NewComePeople/{UserName}/BestFriend": { + "/NewComePeople/{UserName}": { "get": { "tags": [ "NewComePeople.Person" ], - "summary": "Get BestFriend from NewComePeople", - "operationId": "NewComePeople.GetBestFriend", + "summary": "Get entity from NewComePeople by key", + "operationId": "NewComePeople.Person.GetPerson", "parameters": [ { "name": "UserName", @@ -2081,7 +2315,7 @@ ], "responses": { "200": { - "description": "Retrieved navigation property", + "description": "Retrieved entity", "content": { "application/json": { "schema": { @@ -2095,10 +2329,172 @@ } }, "x-ms-docs-operation-type": "operation" - } - }, - "/NewComePeople/{UserName}/BestFriend/$ref": { - "get": { + }, + "patch": { + "tags": [ + "NewComePeople.Person" + ], + "summary": "Update entity in NewComePeople", + "operationId": "NewComePeople.Person.UpdatePerson", + "parameters": [ + { + "name": "UserName", + "in": "path", + "description": "key: UserName of Person", + "required": true, + "schema": { + "type": "string" + }, + "x-ms-docs-key-type": "Person" + } + ], + "requestBody": { + "description": "New property values", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person" + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Success" + }, + "default": { + "$ref": "#/components/responses/error" + } + }, + "x-ms-docs-operation-type": "operation" + }, + "delete": { + "tags": [ + "NewComePeople.Person" + ], + "summary": "Delete entity from NewComePeople", + "operationId": "NewComePeople.Person.DeletePerson", + "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" + } + } + ], + "responses": { + "204": { + "description": "Success" + }, + "default": { + "$ref": "#/components/responses/error" + } + }, + "x-ms-docs-operation-type": "operation" + } + }, + "/NewComePeople/{UserName}/BestFriend": { + "get": { + "tags": [ + "NewComePeople.Person" + ], + "summary": "Get BestFriend from NewComePeople", + "operationId": "NewComePeople.GetBestFriend", + "parameters": [ + { + "name": "UserName", + "in": "path", + "description": "key: UserName of Person", + "required": true, + "schema": { + "type": "string" + }, + "x-ms-docs-key-type": "Person" + }, + { + "name": "$select", + "in": "query", + "description": "Select properties to be returned", + "style": "form", + "explode": false, + "schema": { + "uniqueItems": true, + "type": "array", + "items": { + "enum": [ + "UserName", + "FirstName", + "LastName", + "MiddleName", + "Gender", + "Age", + "Emails", + "AddressInfo", + "HomeAddress", + "FavoriteFeature", + "Features", + "Friends", + "BestFriend", + "Trips" + ], + "type": "string" + } + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities", + "style": "form", + "explode": false, + "schema": { + "uniqueItems": true, + "type": "array", + "items": { + "enum": [ + "*", + "Friends", + "BestFriend", + "Trips" + ], + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved navigation property", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person" + } + } + } + }, + "default": { + "$ref": "#/components/responses/error" + } + }, + "x-ms-docs-operation-type": "operation" + } + }, + "/NewComePeople/{UserName}/BestFriend/$ref": { + "get": { "tags": [ "NewComePeople.Person" ], @@ -2903,15 +3299,13 @@ } }, "x-ms-docs-operation-type": "operation" - } - }, - "/NewComePeople/{UserName}/Trips/$ref": { - "get": { + }, + "post": { "tags": [ "NewComePeople.Trip" ], - "summary": "Get ref of Trips from NewComePeople", - "operationId": "NewComePeople.ListRefTrips", + "summary": "Create new navigation property to Trips for NewComePeople", + "operationId": "NewComePeople.CreateTrips", "parameters": [ { "name": "UserName", @@ -2922,26 +3316,72 @@ "type": "string" }, "x-ms-docs-key-type": "Person" + } + ], + "requestBody": { + "description": "New navigation property", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip" + } + } }, - { - "$ref": "#/components/parameters/top" - }, - { - "$ref": "#/components/parameters/skip" - }, - { - "$ref": "#/components/parameters/search" + "required": true + }, + "responses": { + "201": { + "description": "Created navigation property.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip" + } + } + } }, + "default": { + "$ref": "#/components/responses/error" + } + }, + "x-ms-docs-operation-type": "operation" + } + }, + "/NewComePeople/{UserName}/Trips/{TripId}": { + "get": { + "tags": [ + "NewComePeople.Trip" + ], + "summary": "Get Trips from NewComePeople", + "operationId": "NewComePeople.GetTrips", + "parameters": [ { - "$ref": "#/components/parameters/filter" + "name": "UserName", + "in": "path", + "description": "key: UserName of Person", + "required": true, + "schema": { + "type": "string" + }, + "x-ms-docs-key-type": "Person" }, { - "$ref": "#/components/parameters/count" + "name": "TripId", + "in": "path", + "description": "key: TripId of Trip", + "required": true, + "schema": { + "maximum": 2147483647, + "minimum": -2147483648, + "type": "integer", + "format": "int32" + }, + "x-ms-docs-key-type": "Trip" }, { - "name": "$orderby", + "name": "$select", "in": "query", - "description": "Order items by property values", + "description": "Select properties to be returned", "style": "form", "explode": false, "schema": { @@ -2950,21 +3390,32 @@ "items": { "enum": [ "TripId", - "TripId desc", "ShareId", - "ShareId desc", "Name", - "Name desc", "Budget", - "Budget desc", "Description", - "Description desc", "Tags", - "Tags desc", "StartsAt", - "StartsAt desc", "EndsAt", - "EndsAt desc" + "PlanItems" + ], + "type": "string" + } + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities", + "style": "form", + "explode": false, + "schema": { + "uniqueItems": true, + "type": "array", + "items": { + "enum": [ + "*", + "PlanItems" ], "type": "string" } @@ -2973,20 +3424,11 @@ ], "responses": { "200": { - "description": "Retrieved navigation property links", + "description": "Retrieved navigation property", "content": { "application/json": { "schema": { - "title": "Collection of links of Trip", - "type": "object", - "properties": { - "value": { - "type": "array", - "items": { - "type": "string" - } - } - } + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip" } } } @@ -2997,12 +3439,12 @@ }, "x-ms-docs-operation-type": "operation" }, - "post": { + "patch": { "tags": [ "NewComePeople.Trip" ], - "summary": "Create new navigation property ref to Trips for NewComePeople", - "operationId": "NewComePeople.CreateRefTrips", + "summary": "Update the navigation property Trips in NewComePeople", + "operationId": "NewComePeople.UpdateTrips", "parameters": [ { "name": "UserName", @@ -3013,29 +3455,139 @@ "type": "string" }, "x-ms-docs-key-type": "Person" + }, + { + "name": "TripId", + "in": "path", + "description": "key: TripId of Trip", + "required": true, + "schema": { + "maximum": 2147483647, + "minimum": -2147483648, + "type": "integer", + "format": "int32" + }, + "x-ms-docs-key-type": "Trip" } ], "requestBody": { - "description": "New navigation property ref value", + "description": "New navigation property values", "content": { "application/json": { "schema": { - "type": "object", - "additionalProperties": { - "type": "object" - } + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip" } } }, "required": true }, "responses": { - "201": { - "description": "Created navigation property link.", + "204": { + "description": "Success" + }, + "default": { + "$ref": "#/components/responses/error" + } + }, + "x-ms-docs-operation-type": "operation" + }, + "delete": { + "tags": [ + "NewComePeople.Trip" + ], + "summary": "Delete navigation property Trips for NewComePeople", + "operationId": "NewComePeople.DeleteTrips", + "parameters": [ + { + "name": "UserName", + "in": "path", + "description": "key: UserName of Person", + "required": true, + "schema": { + "type": "string" + }, + "x-ms-docs-key-type": "Person" + }, + { + "name": "TripId", + "in": "path", + "description": "key: TripId of Trip", + "required": true, + "schema": { + "maximum": 2147483647, + "minimum": -2147483648, + "type": "integer", + "format": "int32" + }, + "x-ms-docs-key-type": "Trip" + }, + { + "name": "If-Match", + "in": "header", + "description": "ETag", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Success" + }, + "default": { + "$ref": "#/components/responses/error" + } + }, + "x-ms-docs-operation-type": "operation" + } + }, + "/NewComePeople/{UserName}/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()": { + "get": { + "tags": [ + "NewComePeople.Functions" + ], + "summary": "Invoke function GetInvolvedPeople", + "operationId": "NewComePeople.Trips.GetInvolvedPeople", + "parameters": [ + { + "name": "UserName", + "in": "path", + "description": "key: UserName of Person", + "required": true, + "schema": { + "type": "string" + }, + "x-ms-docs-key-type": "Person" + }, + { + "name": "TripId", + "in": "path", + "description": "key: TripId of Trip", + "required": true, + "schema": { + "maximum": 2147483647, + "minimum": -2147483648, + "type": "integer", + "format": "int32" + }, + "x-ms-docs-key-type": "Trip" + } + ], + "responses": { + "200": { + "description": "Success", "content": { "application/json": { "schema": { - "type": "object" + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person" + } + ], + "nullable": true + } } } } @@ -3044,17 +3596,40 @@ "$ref": "#/components/responses/error" } }, - "x-ms-docs-operation-type": "operation" + "x-ms-docs-operation-type": "function" } }, - "/People": { + "/NewComePeople/{UserName}/Trips/{TripId}/PlanItems": { "get": { "tags": [ - "People.Person" + "NewComePeople.Trips.PlanItem" ], - "summary": "Get entities from People", - "operationId": "People.Person.ListPerson", + "summary": "Get PlanItems from NewComePeople", + "operationId": "NewComePeople.Trips.ListPlanItems", "parameters": [ + { + "name": "UserName", + "in": "path", + "description": "key: UserName of Person", + "required": true, + "schema": { + "type": "string" + }, + "x-ms-docs-key-type": "Person" + }, + { + "name": "TripId", + "in": "path", + "description": "key: TripId of Trip", + "required": true, + "schema": { + "maximum": 2147483647, + "minimum": -2147483648, + "type": "integer", + "format": "int32" + }, + "x-ms-docs-key-type": "Trip" + }, { "$ref": "#/components/parameters/top" }, @@ -3081,28 +3656,16 @@ "type": "array", "items": { "enum": [ - "UserName", - "UserName desc", - "FirstName", - "FirstName desc", - "LastName", - "LastName desc", - "MiddleName", - "MiddleName desc", - "Gender", - "Gender desc", - "Age", - "Age desc", - "Emails", - "Emails desc", - "AddressInfo", - "AddressInfo desc", - "HomeAddress", - "HomeAddress desc", - "FavoriteFeature", - "FavoriteFeature desc", - "Features", - "Features desc" + "PlanItemId", + "PlanItemId desc", + "ConfirmationCode", + "ConfirmationCode desc", + "StartsAt", + "StartsAt desc", + "EndsAt", + "EndsAt desc", + "Duration", + "Duration desc" ], "type": "string" } @@ -3119,20 +3682,11 @@ "type": "array", "items": { "enum": [ - "UserName", - "FirstName", - "LastName", - "MiddleName", - "Gender", - "Age", - "Emails", - "AddressInfo", - "HomeAddress", - "FavoriteFeature", - "Features", - "Friends", - "BestFriend", - "Trips" + "PlanItemId", + "ConfirmationCode", + "StartsAt", + "EndsAt", + "Duration" ], "type": "string" } @@ -3149,10 +3703,7 @@ "type": "array", "items": { "enum": [ - "*", - "Friends", - "BestFriend", - "Trips" + "*" ], "type": "string" } @@ -3161,17 +3712,17 @@ ], "responses": { "200": { - "description": "Retrieved entities", + "description": "Retrieved navigation property", "content": { "application/json": { "schema": { - "title": "Collection of Person", + "title": "Collection of PlanItem", "type": "object", "properties": { "value": { "type": "array", "items": { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person" + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.PlanItem" } } } @@ -3182,50 +3733,17 @@ "default": { "$ref": "#/components/responses/error" } - } - }, - "post": { - "tags": [ - "People.Person" - ], - "summary": "Add new entity to People", - "operationId": "People.Person.CreatePerson", - "requestBody": { - "description": "New entity", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person" - } - } - }, - "required": true - }, - "responses": { - "201": { - "description": "Created entity", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person" - } - } - } - }, - "default": { - "$ref": "#/components/responses/error" - } }, "x-ms-docs-operation-type": "operation" } }, - "/People/{UserName}": { + "/NewComePeople/{UserName}/Trips/{TripId}/PlanItems/$ref": { "get": { "tags": [ - "People.Person" + "NewComePeople.Trips.PlanItem" ], - "summary": "Get entity from People by key", - "operationId": "People.Person.GetPerson", + "summary": "Get ref of PlanItems from NewComePeople", + "operationId": "NewComePeople.Trips.ListRefPlanItems", "parameters": [ { "name": "UserName", @@ -3238,9 +3756,37 @@ "x-ms-docs-key-type": "Person" }, { - "name": "$select", + "name": "TripId", + "in": "path", + "description": "key: TripId of Trip", + "required": true, + "schema": { + "maximum": 2147483647, + "minimum": -2147483648, + "type": "integer", + "format": "int32" + }, + "x-ms-docs-key-type": "Trip" + }, + { + "$ref": "#/components/parameters/top" + }, + { + "$ref": "#/components/parameters/skip" + }, + { + "$ref": "#/components/parameters/search" + }, + { + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/count" + }, + { + "name": "$orderby", "in": "query", - "description": "Select properties to be returned", + "description": "Order items by property values", "style": "form", "explode": false, "schema": { @@ -3248,40 +3794,16 @@ "type": "array", "items": { "enum": [ - "UserName", - "FirstName", - "LastName", - "MiddleName", - "Gender", - "Age", - "Emails", - "AddressInfo", - "HomeAddress", - "FavoriteFeature", - "Features", - "Friends", - "BestFriend", - "Trips" - ], - "type": "string" - } - } - }, - { - "name": "$expand", - "in": "query", - "description": "Expand related entities", - "style": "form", - "explode": false, - "schema": { - "uniqueItems": true, - "type": "array", - "items": { - "enum": [ - "*", - "Friends", - "BestFriend", - "Trips" + "PlanItemId", + "PlanItemId desc", + "ConfirmationCode", + "ConfirmationCode desc", + "StartsAt", + "StartsAt desc", + "EndsAt", + "EndsAt desc", + "Duration", + "Duration desc" ], "type": "string" } @@ -3290,11 +3812,20 @@ ], "responses": { "200": { - "description": "Retrieved entity", + "description": "Retrieved navigation property links", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person" + "title": "Collection of links of PlanItem", + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "type": "string" + } + } + } } } } @@ -3305,12 +3836,12 @@ }, "x-ms-docs-operation-type": "operation" }, - "patch": { + "post": { "tags": [ - "People.Person" + "NewComePeople.Trips.PlanItem" ], - "summary": "Update entity in People", - "operationId": "People.Person.UpdatePerson", + "summary": "Create new navigation property ref to PlanItems for NewComePeople", + "operationId": "NewComePeople.Trips.CreateRefPlanItems", "parameters": [ { "name": "UserName", @@ -3321,58 +3852,217 @@ "type": "string" }, "x-ms-docs-key-type": "Person" + }, + { + "name": "TripId", + "in": "path", + "description": "key: TripId of Trip", + "required": true, + "schema": { + "maximum": 2147483647, + "minimum": -2147483648, + "type": "integer", + "format": "int32" + }, + "x-ms-docs-key-type": "Trip" } ], "requestBody": { - "description": "New property values", + "description": "New navigation property ref value", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person" + "type": "object", + "additionalProperties": { + "type": "object" + } } } }, "required": true }, "responses": { - "204": { - "description": "Success" + "201": { + "description": "Created navigation property link.", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } }, "default": { "$ref": "#/components/responses/error" } }, "x-ms-docs-operation-type": "operation" - }, - "delete": { + } + }, + "/People": { + "get": { "tags": [ "People.Person" ], - "summary": "Delete entity from People", - "operationId": "People.Person.DeletePerson", + "summary": "Get entities from People", + "operationId": "People.Person.ListPerson", "parameters": [ { - "name": "UserName", - "in": "path", - "description": "key: UserName of Person", - "required": true, + "$ref": "#/components/parameters/top" + }, + { + "$ref": "#/components/parameters/skip" + }, + { + "$ref": "#/components/parameters/search" + }, + { + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/count" + }, + { + "name": "$orderby", + "in": "query", + "description": "Order items by property values", + "style": "form", + "explode": false, "schema": { - "type": "string" - }, - "x-ms-docs-key-type": "Person" + "uniqueItems": true, + "type": "array", + "items": { + "enum": [ + "UserName", + "UserName desc", + "FirstName", + "FirstName desc", + "LastName", + "LastName desc", + "MiddleName", + "MiddleName desc", + "Gender", + "Gender desc", + "Age", + "Age desc", + "Emails", + "Emails desc", + "AddressInfo", + "AddressInfo desc", + "HomeAddress", + "HomeAddress desc", + "FavoriteFeature", + "FavoriteFeature desc", + "Features", + "Features desc" + ], + "type": "string" + } + } }, { - "name": "If-Match", - "in": "header", - "description": "ETag", + "name": "$select", + "in": "query", + "description": "Select properties to be returned", + "style": "form", + "explode": false, "schema": { - "type": "string" + "uniqueItems": true, + "type": "array", + "items": { + "enum": [ + "UserName", + "FirstName", + "LastName", + "MiddleName", + "Gender", + "Age", + "Emails", + "AddressInfo", + "HomeAddress", + "FavoriteFeature", + "Features", + "Friends", + "BestFriend", + "Trips" + ], + "type": "string" + } + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities", + "style": "form", + "explode": false, + "schema": { + "uniqueItems": true, + "type": "array", + "items": { + "enum": [ + "*", + "Friends", + "BestFriend", + "Trips" + ], + "type": "string" + } } } ], "responses": { - "204": { - "description": "Success" + "200": { + "description": "Retrieved entities", + "content": { + "application/json": { + "schema": { + "title": "Collection of Person", + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person" + } + } + } + } + } + } + }, + "default": { + "$ref": "#/components/responses/error" + } + } + }, + "post": { + "tags": [ + "People.Person" + ], + "summary": "Add new entity to People", + "operationId": "People.Person.CreatePerson", + "requestBody": { + "description": "New entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Created entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person" + } + } + } }, "default": { "$ref": "#/components/responses/error" @@ -3381,13 +4071,13 @@ "x-ms-docs-operation-type": "operation" } }, - "/People/{UserName}/BestFriend": { + "/People/{UserName}": { "get": { "tags": [ "People.Person" ], - "summary": "Get BestFriend from People", - "operationId": "People.GetBestFriend", + "summary": "Get entity from People by key", + "operationId": "People.Person.GetPerson", "parameters": [ { "name": "UserName", @@ -3452,7 +4142,7 @@ ], "responses": { "200": { - "description": "Retrieved navigation property", + "description": "Retrieved entity", "content": { "application/json": { "schema": { @@ -3466,15 +4156,13 @@ } }, "x-ms-docs-operation-type": "operation" - } - }, - "/People/{UserName}/BestFriend/$ref": { - "get": { + }, + "patch": { "tags": [ "People.Person" ], - "summary": "Get ref of BestFriend from People", - "operationId": "People.GetRefBestFriend", + "summary": "Update entity in People", + "operationId": "People.Person.UpdatePerson", "parameters": [ { "name": "UserName", @@ -3487,10 +4175,174 @@ "x-ms-docs-key-type": "Person" } ], - "responses": { - "200": { - "description": "Retrieved navigation property link", - "content": { + "requestBody": { + "description": "New property values", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person" + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Success" + }, + "default": { + "$ref": "#/components/responses/error" + } + }, + "x-ms-docs-operation-type": "operation" + }, + "delete": { + "tags": [ + "People.Person" + ], + "summary": "Delete entity from People", + "operationId": "People.Person.DeletePerson", + "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" + } + } + ], + "responses": { + "204": { + "description": "Success" + }, + "default": { + "$ref": "#/components/responses/error" + } + }, + "x-ms-docs-operation-type": "operation" + } + }, + "/People/{UserName}/BestFriend": { + "get": { + "tags": [ + "People.Person" + ], + "summary": "Get BestFriend from People", + "operationId": "People.GetBestFriend", + "parameters": [ + { + "name": "UserName", + "in": "path", + "description": "key: UserName of Person", + "required": true, + "schema": { + "type": "string" + }, + "x-ms-docs-key-type": "Person" + }, + { + "name": "$select", + "in": "query", + "description": "Select properties to be returned", + "style": "form", + "explode": false, + "schema": { + "uniqueItems": true, + "type": "array", + "items": { + "enum": [ + "UserName", + "FirstName", + "LastName", + "MiddleName", + "Gender", + "Age", + "Emails", + "AddressInfo", + "HomeAddress", + "FavoriteFeature", + "Features", + "Friends", + "BestFriend", + "Trips" + ], + "type": "string" + } + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities", + "style": "form", + "explode": false, + "schema": { + "uniqueItems": true, + "type": "array", + "items": { + "enum": [ + "*", + "Friends", + "BestFriend", + "Trips" + ], + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved navigation property", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person" + } + } + } + }, + "default": { + "$ref": "#/components/responses/error" + } + }, + "x-ms-docs-operation-type": "operation" + } + }, + "/People/{UserName}/BestFriend/$ref": { + "get": { + "tags": [ + "People.Person" + ], + "summary": "Get ref of BestFriend from People", + "operationId": "People.GetRefBestFriend", + "parameters": [ + { + "name": "UserName", + "in": "path", + "description": "key: UserName of Person", + "required": true, + "schema": { + "type": "string" + }, + "x-ms-docs-key-type": "Person" + } + ], + "responses": { + "200": { + "description": "Retrieved navigation property link", + "content": { "application/json": { "schema": { "type": "string" @@ -3919,16 +4771,416 @@ "$ref": "#/components/responses/error" } }, - "x-ms-docs-operation-type": "function" + "x-ms-docs-operation-type": "function" + } + }, + "/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFriendsTrips(userName={userName})": { + "get": { + "tags": [ + "People.Functions" + ], + "summary": "Invoke function GetFriendsTrips", + "operationId": "People.GetFriendsTrips", + "parameters": [ + { + "name": "UserName", + "in": "path", + "description": "key: UserName of Person", + "required": true, + "schema": { + "type": "string" + }, + "x-ms-docs-key-type": "Person" + }, + { + "name": "userName", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip" + } + ], + "nullable": true + } + } + } + } + }, + "default": { + "$ref": "#/components/responses/error" + } + }, + "x-ms-docs-operation-type": "function" + } + }, + "/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetPeersForTrip": { + "post": { + "tags": [ + "People.Actions" + ], + "summary": "Invoke action GetPeersForTrip", + "operationId": "People.GetPeersForTrip", + "parameters": [ + { + "name": "UserName", + "in": "path", + "description": "key: UserName of Person", + "required": true, + "schema": { + "type": "string" + }, + "x-ms-docs-key-type": "Person" + } + ], + "requestBody": { + "description": "Action parameters", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "userName": { + "type": "string" + }, + "tripId": { + "maximum": 2147483647, + "minimum": -2147483648, + "type": "integer", + "format": "int32" + } + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person" + } + ], + "nullable": true + } + } + } + } + }, + "default": { + "$ref": "#/components/responses/error" + } + }, + "x-ms-docs-operation-type": "action" + } + }, + "/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.ShareTrip": { + "post": { + "tags": [ + "People.Actions" + ], + "summary": "Invoke action ShareTrip", + "operationId": "People.ShareTrip", + "parameters": [ + { + "name": "UserName", + "in": "path", + "description": "key: UserName of Person", + "required": true, + "schema": { + "type": "string" + }, + "x-ms-docs-key-type": "Person" + } + ], + "requestBody": { + "description": "Action parameters", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "userName": { + "type": "string" + }, + "tripId": { + "maximum": 2147483647, + "minimum": -2147483648, + "type": "integer", + "format": "int32" + } + } + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Success" + }, + "default": { + "$ref": "#/components/responses/error" + } + }, + "x-ms-docs-operation-type": "action" + } + }, + "/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.UpdatePersonLastName(lastName={lastName})": { + "get": { + "tags": [ + "People.Functions" + ], + "summary": "Invoke function UpdatePersonLastName", + "operationId": "People.UpdatePersonLastName", + "parameters": [ + { + "name": "UserName", + "in": "path", + "description": "key: UserName of Person", + "required": true, + "schema": { + "type": "string" + }, + "x-ms-docs-key-type": "Person" + }, + { + "name": "lastName", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "boolean", + "default": false + } + } + } + }, + "default": { + "$ref": "#/components/responses/error" + } + }, + "x-ms-docs-operation-type": "function" + } + }, + "/People/{UserName}/Trips": { + "get": { + "tags": [ + "People.Trip" + ], + "summary": "Get Trips from People", + "operationId": "People.ListTrips", + "parameters": [ + { + "name": "UserName", + "in": "path", + "description": "key: UserName of Person", + "required": true, + "schema": { + "type": "string" + }, + "x-ms-docs-key-type": "Person" + }, + { + "$ref": "#/components/parameters/top" + }, + { + "$ref": "#/components/parameters/skip" + }, + { + "$ref": "#/components/parameters/search" + }, + { + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/count" + }, + { + "name": "$orderby", + "in": "query", + "description": "Order items by property values", + "style": "form", + "explode": false, + "schema": { + "uniqueItems": true, + "type": "array", + "items": { + "enum": [ + "TripId", + "TripId desc", + "ShareId", + "ShareId desc", + "Name", + "Name desc", + "Budget", + "Budget desc", + "Description", + "Description desc", + "Tags", + "Tags desc", + "StartsAt", + "StartsAt desc", + "EndsAt", + "EndsAt desc" + ], + "type": "string" + } + } + }, + { + "name": "$select", + "in": "query", + "description": "Select properties to be returned", + "style": "form", + "explode": false, + "schema": { + "uniqueItems": true, + "type": "array", + "items": { + "enum": [ + "TripId", + "ShareId", + "Name", + "Budget", + "Description", + "Tags", + "StartsAt", + "EndsAt", + "PlanItems" + ], + "type": "string" + } + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities", + "style": "form", + "explode": false, + "schema": { + "uniqueItems": true, + "type": "array", + "items": { + "enum": [ + "*", + "PlanItems" + ], + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved navigation property", + "content": { + "application/json": { + "schema": { + "title": "Collection of Trip", + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip" + } + } + } + } + } + } + }, + "default": { + "$ref": "#/components/responses/error" + } + }, + "x-ms-docs-operation-type": "operation" + }, + "post": { + "tags": [ + "People.Trip" + ], + "summary": "Create new navigation property to Trips for People", + "operationId": "People.CreateTrips", + "parameters": [ + { + "name": "UserName", + "in": "path", + "description": "key: UserName of Person", + "required": true, + "schema": { + "type": "string" + }, + "x-ms-docs-key-type": "Person" + } + ], + "requestBody": { + "description": "New navigation property", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Created navigation property.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip" + } + } + } + }, + "default": { + "$ref": "#/components/responses/error" + } + }, + "x-ms-docs-operation-type": "operation" } }, - "/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFriendsTrips(userName={userName})": { + "/People/{UserName}/Trips/{TripId}": { "get": { "tags": [ - "People.Functions" + "People.Trip" ], - "summary": "Invoke function GetFriendsTrips", - "operationId": "People.GetFriendsTrips", + "summary": "Get Trips from People", + "operationId": "People.GetTrips", "parameters": [ { "name": "UserName", @@ -3941,29 +5193,69 @@ "x-ms-docs-key-type": "Person" }, { - "name": "userName", + "name": "TripId", "in": "path", + "description": "key: TripId of Trip", "required": true, "schema": { - "type": "string" + "maximum": 2147483647, + "minimum": -2147483648, + "type": "integer", + "format": "int32" + }, + "x-ms-docs-key-type": "Trip" + }, + { + "name": "$select", + "in": "query", + "description": "Select properties to be returned", + "style": "form", + "explode": false, + "schema": { + "uniqueItems": true, + "type": "array", + "items": { + "enum": [ + "TripId", + "ShareId", + "Name", + "Budget", + "Description", + "Tags", + "StartsAt", + "EndsAt", + "PlanItems" + ], + "type": "string" + } + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities", + "style": "form", + "explode": false, + "schema": { + "uniqueItems": true, + "type": "array", + "items": { + "enum": [ + "*", + "PlanItems" + ], + "type": "string" + } } } ], "responses": { "200": { - "description": "Success", + "description": "Retrieved navigation property", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip" - } - ], - "nullable": true - } + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip" } } } @@ -3972,16 +5264,14 @@ "$ref": "#/components/responses/error" } }, - "x-ms-docs-operation-type": "function" - } - }, - "/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetPeersForTrip": { - "post": { + "x-ms-docs-operation-type": "operation" + }, + "patch": { "tags": [ - "People.Actions" + "People.Trip" ], - "summary": "Invoke action GetPeersForTrip", - "operationId": "People.GetPeersForTrip", + "summary": "Update the navigation property Trips in People", + "operationId": "People.UpdateTrips", "parameters": [ { "name": "UserName", @@ -3992,63 +5282,48 @@ "type": "string" }, "x-ms-docs-key-type": "Person" + }, + { + "name": "TripId", + "in": "path", + "description": "key: TripId of Trip", + "required": true, + "schema": { + "maximum": 2147483647, + "minimum": -2147483648, + "type": "integer", + "format": "int32" + }, + "x-ms-docs-key-type": "Trip" } ], "requestBody": { - "description": "Action parameters", + "description": "New navigation property values", "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "userName": { - "type": "string" - }, - "tripId": { - "maximum": 2147483647, - "minimum": -2147483648, - "type": "integer", - "format": "int32" - } - } + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip" } } }, "required": true }, "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person" - } - ], - "nullable": true - } - } - } - } + "204": { + "description": "Success" }, "default": { "$ref": "#/components/responses/error" } }, - "x-ms-docs-operation-type": "action" - } - }, - "/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.ShareTrip": { - "post": { + "x-ms-docs-operation-type": "operation" + }, + "delete": { "tags": [ - "People.Actions" + "People.Trip" ], - "summary": "Invoke action ShareTrip", - "operationId": "People.ShareTrip", + "summary": "Delete navigation property Trips for People", + "operationId": "People.DeleteTrips", "parameters": [ { "name": "UserName", @@ -4059,30 +5334,29 @@ "type": "string" }, "x-ms-docs-key-type": "Person" + }, + { + "name": "TripId", + "in": "path", + "description": "key: TripId of Trip", + "required": true, + "schema": { + "maximum": 2147483647, + "minimum": -2147483648, + "type": "integer", + "format": "int32" + }, + "x-ms-docs-key-type": "Trip" + }, + { + "name": "If-Match", + "in": "header", + "description": "ETag", + "schema": { + "type": "string" + } } ], - "requestBody": { - "description": "Action parameters", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "userName": { - "type": "string" - }, - "tripId": { - "maximum": 2147483647, - "minimum": -2147483648, - "type": "integer", - "format": "int32" - } - } - } - } - }, - "required": true - }, "responses": { "204": { "description": "Success" @@ -4091,16 +5365,16 @@ "$ref": "#/components/responses/error" } }, - "x-ms-docs-operation-type": "action" + "x-ms-docs-operation-type": "operation" } }, - "/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.UpdatePersonLastName(lastName={lastName})": { + "/People/{UserName}/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()": { "get": { "tags": [ "People.Functions" ], - "summary": "Invoke function UpdatePersonLastName", - "operationId": "People.UpdatePersonLastName", + "summary": "Invoke function GetInvolvedPeople", + "operationId": "People.Trips.GetInvolvedPeople", "parameters": [ { "name": "UserName", @@ -4113,12 +5387,17 @@ "x-ms-docs-key-type": "Person" }, { - "name": "lastName", + "name": "TripId", "in": "path", + "description": "key: TripId of Trip", "required": true, "schema": { - "type": "string" - } + "maximum": 2147483647, + "minimum": -2147483648, + "type": "integer", + "format": "int32" + }, + "x-ms-docs-key-type": "Trip" } ], "responses": { @@ -4127,8 +5406,15 @@ "content": { "application/json": { "schema": { - "type": "boolean", - "default": false + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person" + } + ], + "nullable": true + } } } } @@ -4140,13 +5426,13 @@ "x-ms-docs-operation-type": "function" } }, - "/People/{UserName}/Trips": { + "/People/{UserName}/Trips/{TripId}/PlanItems": { "get": { "tags": [ - "People.Trip" + "People.Trips.PlanItem" ], - "summary": "Get Trips from People", - "operationId": "People.ListTrips", + "summary": "Get PlanItems from People", + "operationId": "People.Trips.ListPlanItems", "parameters": [ { "name": "UserName", @@ -4158,6 +5444,19 @@ }, "x-ms-docs-key-type": "Person" }, + { + "name": "TripId", + "in": "path", + "description": "key: TripId of Trip", + "required": true, + "schema": { + "maximum": 2147483647, + "minimum": -2147483648, + "type": "integer", + "format": "int32" + }, + "x-ms-docs-key-type": "Trip" + }, { "$ref": "#/components/parameters/top" }, @@ -4184,22 +5483,16 @@ "type": "array", "items": { "enum": [ - "TripId", - "TripId desc", - "ShareId", - "ShareId desc", - "Name", - "Name desc", - "Budget", - "Budget desc", - "Description", - "Description desc", - "Tags", - "Tags desc", + "PlanItemId", + "PlanItemId desc", + "ConfirmationCode", + "ConfirmationCode desc", "StartsAt", "StartsAt desc", "EndsAt", - "EndsAt desc" + "EndsAt desc", + "Duration", + "Duration desc" ], "type": "string" } @@ -4216,15 +5509,11 @@ "type": "array", "items": { "enum": [ - "TripId", - "ShareId", - "Name", - "Budget", - "Description", - "Tags", + "PlanItemId", + "ConfirmationCode", "StartsAt", "EndsAt", - "PlanItems" + "Duration" ], "type": "string" } @@ -4241,8 +5530,7 @@ "type": "array", "items": { "enum": [ - "*", - "PlanItems" + "*" ], "type": "string" } @@ -4255,13 +5543,13 @@ "content": { "application/json": { "schema": { - "title": "Collection of Trip", + "title": "Collection of PlanItem", "type": "object", "properties": { "value": { "type": "array", "items": { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip" + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.PlanItem" } } } @@ -4276,13 +5564,13 @@ "x-ms-docs-operation-type": "operation" } }, - "/People/{UserName}/Trips/$ref": { + "/People/{UserName}/Trips/{TripId}/PlanItems/$ref": { "get": { "tags": [ - "People.Trip" + "People.Trips.PlanItem" ], - "summary": "Get ref of Trips from People", - "operationId": "People.ListRefTrips", + "summary": "Get ref of PlanItems from People", + "operationId": "People.Trips.ListRefPlanItems", "parameters": [ { "name": "UserName", @@ -4294,6 +5582,19 @@ }, "x-ms-docs-key-type": "Person" }, + { + "name": "TripId", + "in": "path", + "description": "key: TripId of Trip", + "required": true, + "schema": { + "maximum": 2147483647, + "minimum": -2147483648, + "type": "integer", + "format": "int32" + }, + "x-ms-docs-key-type": "Trip" + }, { "$ref": "#/components/parameters/top" }, @@ -4320,22 +5621,16 @@ "type": "array", "items": { "enum": [ - "TripId", - "TripId desc", - "ShareId", - "ShareId desc", - "Name", - "Name desc", - "Budget", - "Budget desc", - "Description", - "Description desc", - "Tags", - "Tags desc", + "PlanItemId", + "PlanItemId desc", + "ConfirmationCode", + "ConfirmationCode desc", "StartsAt", "StartsAt desc", "EndsAt", - "EndsAt desc" + "EndsAt desc", + "Duration", + "Duration desc" ], "type": "string" } @@ -4348,7 +5643,7 @@ "content": { "application/json": { "schema": { - "title": "Collection of links of Trip", + "title": "Collection of links of PlanItem", "type": "object", "properties": { "value": { @@ -4370,10 +5665,10 @@ }, "post": { "tags": [ - "People.Trip" + "People.Trips.PlanItem" ], - "summary": "Create new navigation property ref to Trips for People", - "operationId": "People.CreateRefTrips", + "summary": "Create new navigation property ref to PlanItems for People", + "operationId": "People.Trips.CreateRefPlanItems", "parameters": [ { "name": "UserName", @@ -4384,6 +5679,19 @@ "type": "string" }, "x-ms-docs-key-type": "Person" + }, + { + "name": "TripId", + "in": "path", + "description": "key: TripId of Trip", + "required": true, + "schema": { + "maximum": 2147483647, + "minimum": -2147483648, + "type": "integer", + "format": "int32" + }, + "x-ms-docs-key-type": "Trip" } ], "requestBody": { @@ -5441,6 +6749,10 @@ "name": "Me.Trip", "x-ms-docs-toc-type": "page" }, + { + "name": "Me.Trips.PlanItem", + "x-ms-docs-toc-type": "page" + }, { "name": "NewComePeople.Person", "x-ms-docs-toc-type": "page" @@ -5457,6 +6769,10 @@ "name": "NewComePeople.Trip", "x-ms-docs-toc-type": "page" }, + { + "name": "NewComePeople.Trips.PlanItem", + "x-ms-docs-toc-type": "page" + }, { "name": "People.Person", "x-ms-docs-toc-type": "page" @@ -5473,6 +6789,10 @@ "name": "People.Trip", "x-ms-docs-toc-type": "page" }, + { + "name": "People.Trips.PlanItem", + "x-ms-docs-toc-type": "page" + }, { "name": "ResetDataSource", "x-ms-docs-toc-type": "container" 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..ad73cb2a 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml @@ -737,70 +737,6 @@ paths: default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation - '/Me/Friends/{UserName}': - get: - tags: - - Me.Person - summary: Get Friends from Me - operationId: Me.GetFriends - parameters: - - name: UserName - in: path - description: 'key: UserName of Person' - required: true - schema: - type: string - x-ms-docs-key-type: Person - - name: $select - in: query - description: Select properties to be returned - style: form - explode: false - schema: - uniqueItems: true - type: array - items: - enum: - - UserName - - FirstName - - LastName - - MiddleName - - Gender - - Age - - Emails - - AddressInfo - - HomeAddress - - FavoriteFeature - - Features - - Friends - - BestFriend - - Trips - type: string - - name: $expand - in: query - description: Expand related entities - style: form - explode: false - schema: - uniqueItems: true - type: array - items: - enum: - - '*' - - Friends - - BestFriend - - Trips - type: string - responses: - '200': - description: Retrieved navigation property - content: - application/json: - schema: - $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person' - default: - $ref: '#/components/responses/error' - x-ms-docs-operation-type: operation /Me/Friends/$ref: get: tags: @@ -1103,6 +1039,28 @@ paths: default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation + post: + tags: + - Me.Trip + summary: Create new navigation property to Trips for Me + operationId: Me.CreateTrips + requestBody: + description: New navigation property + content: + application/json: + schema: + $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip' + required: true + responses: + '201': + description: Created navigation property. + content: + application/json: + schema: + $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip' + default: + $ref: '#/components/responses/error' + x-ms-docs-operation-type: operation '/Me/Trips/{TripId}': get: tags: @@ -1163,6 +1121,62 @@ paths: default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation + patch: + tags: + - Me.Trip + summary: Update the navigation property Trips in Me + operationId: Me.UpdateTrips + parameters: + - name: TripId + in: path + description: 'key: TripId of Trip' + required: true + schema: + maximum: 2147483647 + minimum: -2147483648 + type: integer + format: int32 + x-ms-docs-key-type: Trip + requestBody: + description: New navigation property values + content: + application/json: + schema: + $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip' + required: true + responses: + '204': + description: Success + default: + $ref: '#/components/responses/error' + x-ms-docs-operation-type: operation + delete: + tags: + - Me.Trip + summary: Delete navigation property Trips for Me + operationId: Me.DeleteTrips + parameters: + - name: TripId + in: path + description: 'key: TripId of Trip' + required: true + schema: + maximum: 2147483647 + minimum: -2147483648 + type: integer + format: int32 + x-ms-docs-key-type: Trip + - name: If-Match + in: header + description: ETag + schema: + type: string + responses: + '204': + description: Success + default: + $ref: '#/components/responses/error' + x-ms-docs-operation-type: operation '/Me/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()': get: tags: @@ -1194,13 +1208,23 @@ paths: default: $ref: '#/components/responses/error' x-ms-docs-operation-type: function - /Me/Trips/$ref: + '/Me/Trips/{TripId}/PlanItems': get: tags: - - Me.Trip - summary: Get ref of Trips from Me - operationId: Me.ListRefTrips + - Me.Trips.PlanItem + summary: Get PlanItems from Me + operationId: Me.Trips.ListPlanItems parameters: + - name: TripId + in: path + description: 'key: TripId of Trip' + required: true + schema: + maximum: 2147483647 + minimum: -2147483648 + type: integer + format: int32 + x-ms-docs-key-type: Trip - $ref: '#/components/parameters/top' - $ref: '#/components/parameters/skip' - $ref: '#/components/parameters/search' @@ -1216,22 +1240,103 @@ paths: type: array items: enum: - - TripId - - TripId desc - - ShareId - - ShareId desc - - Name - - Name desc - - Budget - - Budget desc - - Description - - Description desc - - Tags - - Tags desc + - PlanItemId + - PlanItemId desc + - ConfirmationCode + - ConfirmationCode desc + - StartsAt + - StartsAt desc + - EndsAt + - EndsAt desc + - Duration + - Duration desc + type: string + - name: $select + in: query + description: Select properties to be returned + style: form + explode: false + schema: + uniqueItems: true + type: array + items: + enum: + - PlanItemId + - ConfirmationCode + - StartsAt + - EndsAt + - Duration + type: string + - name: $expand + in: query + description: Expand related entities + style: form + explode: false + schema: + uniqueItems: true + type: array + items: + enum: + - '*' + type: string + responses: + '200': + description: Retrieved navigation property + content: + application/json: + schema: + title: Collection of PlanItem + type: object + properties: + value: + type: array + items: + $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.PlanItem' + default: + $ref: '#/components/responses/error' + x-ms-docs-operation-type: operation + '/Me/Trips/{TripId}/PlanItems/$ref': + get: + tags: + - Me.Trips.PlanItem + summary: Get ref of PlanItems from Me + operationId: Me.Trips.ListRefPlanItems + parameters: + - name: TripId + in: path + description: 'key: TripId of Trip' + required: true + schema: + maximum: 2147483647 + minimum: -2147483648 + type: integer + format: int32 + x-ms-docs-key-type: Trip + - $ref: '#/components/parameters/top' + - $ref: '#/components/parameters/skip' + - $ref: '#/components/parameters/search' + - $ref: '#/components/parameters/filter' + - $ref: '#/components/parameters/count' + - name: $orderby + in: query + description: Order items by property values + style: form + explode: false + schema: + uniqueItems: true + type: array + items: + enum: + - PlanItemId + - PlanItemId desc + - ConfirmationCode + - ConfirmationCode desc - StartsAt - StartsAt desc - EndsAt - EndsAt desc + - Duration + - Duration desc type: string responses: '200': @@ -1239,7 +1344,7 @@ paths: content: application/json: schema: - title: Collection of links of Trip + title: Collection of links of PlanItem type: object properties: value: @@ -1251,9 +1356,20 @@ paths: x-ms-docs-operation-type: operation post: tags: - - Me.Trip - summary: Create new navigation property ref to Trips for Me - operationId: Me.CreateRefTrips + - Me.Trips.PlanItem + summary: Create new navigation property ref to PlanItems for Me + operationId: Me.Trips.CreateRefPlanItems + parameters: + - name: TripId + in: path + description: 'key: TripId of Trip' + required: true + schema: + maximum: 2147483647 + minimum: -2147483648 + type: integer + format: int32 + x-ms-docs-key-type: Trip requestBody: description: New navigation property ref value content: @@ -1757,12 +1873,12 @@ paths: default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation - '/NewComePeople/{UserName}/Friends/{UserName1}': + '/NewComePeople/{UserName}/Friends/$ref': get: tags: - NewComePeople.Person - summary: Get Friends from NewComePeople - operationId: NewComePeople.GetFriends + summary: Get ref of Friends from NewComePeople + operationId: NewComePeople.ListRefFriends parameters: - name: UserName in: path @@ -1771,16 +1887,14 @@ paths: schema: type: string x-ms-docs-key-type: Person - - name: UserName1 - in: path - description: 'key: UserName of Person' - required: true - schema: - type: string - x-ms-docs-key-type: Person - - name: $select + - $ref: '#/components/parameters/top' + - $ref: '#/components/parameters/skip' + - $ref: '#/components/parameters/search' + - $ref: '#/components/parameters/filter' + - $ref: '#/components/parameters/count' + - name: $orderby in: query - description: Select properties to be returned + description: Order items by property values style: form explode: false schema: @@ -1789,76 +1903,7 @@ paths: items: enum: - UserName - - FirstName - - LastName - - MiddleName - - Gender - - Age - - Emails - - AddressInfo - - HomeAddress - - FavoriteFeature - - Features - - Friends - - BestFriend - - Trips - type: string - - name: $expand - in: query - description: Expand related entities - style: form - explode: false - schema: - uniqueItems: true - type: array - items: - enum: - - '*' - - Friends - - BestFriend - - Trips - type: string - responses: - '200': - description: Retrieved navigation property - content: - application/json: - schema: - $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person' - default: - $ref: '#/components/responses/error' - x-ms-docs-operation-type: operation - '/NewComePeople/{UserName}/Friends/$ref': - get: - tags: - - NewComePeople.Person - summary: Get ref of Friends from NewComePeople - operationId: NewComePeople.ListRefFriends - parameters: - - name: UserName - in: path - description: 'key: UserName of Person' - required: true - schema: - type: string - x-ms-docs-key-type: Person - - $ref: '#/components/parameters/top' - - $ref: '#/components/parameters/skip' - - $ref: '#/components/parameters/search' - - $ref: '#/components/parameters/filter' - - $ref: '#/components/parameters/count' - - name: $orderby - in: query - description: Order items by property values - style: form - explode: false - schema: - uniqueItems: true - type: array - items: - enum: - - UserName - - UserName desc + - UserName desc - FirstName - FirstName desc - LastName @@ -2190,6 +2235,36 @@ paths: default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation + post: + tags: + - NewComePeople.Trip + summary: Create new navigation property to Trips for NewComePeople + operationId: NewComePeople.CreateTrips + parameters: + - name: UserName + in: path + description: 'key: UserName of Person' + required: true + schema: + type: string + x-ms-docs-key-type: Person + requestBody: + description: New navigation property + content: + application/json: + schema: + $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip' + required: true + responses: + '201': + description: Created navigation property. + content: + application/json: + schema: + $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip' + default: + $ref: '#/components/responses/error' + x-ms-docs-operation-type: operation '/NewComePeople/{UserName}/Trips/{TripId}': get: tags: @@ -2257,6 +2332,76 @@ paths: default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation + patch: + tags: + - NewComePeople.Trip + summary: Update the navigation property Trips in NewComePeople + operationId: NewComePeople.UpdateTrips + parameters: + - name: UserName + in: path + description: 'key: UserName of Person' + required: true + schema: + type: string + x-ms-docs-key-type: Person + - name: TripId + in: path + description: 'key: TripId of Trip' + required: true + schema: + maximum: 2147483647 + minimum: -2147483648 + type: integer + format: int32 + x-ms-docs-key-type: Trip + requestBody: + description: New navigation property values + content: + application/json: + schema: + $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip' + required: true + responses: + '204': + description: Success + default: + $ref: '#/components/responses/error' + x-ms-docs-operation-type: operation + delete: + tags: + - NewComePeople.Trip + summary: Delete navigation property Trips for NewComePeople + operationId: NewComePeople.DeleteTrips + parameters: + - name: UserName + in: path + description: 'key: UserName of Person' + required: true + schema: + type: string + x-ms-docs-key-type: Person + - name: TripId + in: path + description: 'key: TripId of Trip' + required: true + schema: + maximum: 2147483647 + minimum: -2147483648 + type: integer + format: int32 + x-ms-docs-key-type: Trip + - name: If-Match + in: header + description: ETag + schema: + type: string + responses: + '204': + description: Success + default: + $ref: '#/components/responses/error' + x-ms-docs-operation-type: operation '/NewComePeople/{UserName}/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()': get: tags: @@ -2295,12 +2440,12 @@ paths: default: $ref: '#/components/responses/error' x-ms-docs-operation-type: function - '/NewComePeople/{UserName}/Trips/$ref': + '/NewComePeople/{UserName}/Trips/{TripId}/PlanItems': get: tags: - - NewComePeople.Trip - summary: Get ref of Trips from NewComePeople - operationId: NewComePeople.ListRefTrips + - NewComePeople.Trips.PlanItem + summary: Get PlanItems from NewComePeople + operationId: NewComePeople.Trips.ListPlanItems parameters: - name: UserName in: path @@ -2309,6 +2454,16 @@ paths: schema: type: string x-ms-docs-key-type: Person + - name: TripId + in: path + description: 'key: TripId of Trip' + required: true + schema: + maximum: 2147483647 + minimum: -2147483648 + type: integer + format: int32 + x-ms-docs-key-type: Trip - $ref: '#/components/parameters/top' - $ref: '#/components/parameters/skip' - $ref: '#/components/parameters/search' @@ -2324,22 +2479,110 @@ paths: type: array items: enum: - - TripId - - TripId desc - - ShareId - - ShareId desc - - Name - - Name desc - - Budget - - Budget desc - - Description - - Description desc - - Tags - - Tags desc + - PlanItemId + - PlanItemId desc + - ConfirmationCode + - ConfirmationCode desc - StartsAt - StartsAt desc - EndsAt - EndsAt desc + - Duration + - Duration desc + type: string + - name: $select + in: query + description: Select properties to be returned + style: form + explode: false + schema: + uniqueItems: true + type: array + items: + enum: + - PlanItemId + - ConfirmationCode + - StartsAt + - EndsAt + - Duration + type: string + - name: $expand + in: query + description: Expand related entities + style: form + explode: false + schema: + uniqueItems: true + type: array + items: + enum: + - '*' + type: string + responses: + '200': + description: Retrieved navigation property + content: + application/json: + schema: + title: Collection of PlanItem + type: object + properties: + value: + type: array + items: + $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.PlanItem' + default: + $ref: '#/components/responses/error' + x-ms-docs-operation-type: operation + '/NewComePeople/{UserName}/Trips/{TripId}/PlanItems/$ref': + get: + tags: + - NewComePeople.Trips.PlanItem + summary: Get ref of PlanItems from NewComePeople + operationId: NewComePeople.Trips.ListRefPlanItems + parameters: + - name: UserName + in: path + description: 'key: UserName of Person' + required: true + schema: + type: string + x-ms-docs-key-type: Person + - name: TripId + in: path + description: 'key: TripId of Trip' + required: true + schema: + maximum: 2147483647 + minimum: -2147483648 + type: integer + format: int32 + x-ms-docs-key-type: Trip + - $ref: '#/components/parameters/top' + - $ref: '#/components/parameters/skip' + - $ref: '#/components/parameters/search' + - $ref: '#/components/parameters/filter' + - $ref: '#/components/parameters/count' + - name: $orderby + in: query + description: Order items by property values + style: form + explode: false + schema: + uniqueItems: true + type: array + items: + enum: + - PlanItemId + - PlanItemId desc + - ConfirmationCode + - ConfirmationCode desc + - StartsAt + - StartsAt desc + - EndsAt + - EndsAt desc + - Duration + - Duration desc type: string responses: '200': @@ -2347,7 +2590,7 @@ paths: content: application/json: schema: - title: Collection of links of Trip + title: Collection of links of PlanItem type: object properties: value: @@ -2359,9 +2602,9 @@ paths: x-ms-docs-operation-type: operation post: tags: - - NewComePeople.Trip - summary: Create new navigation property ref to Trips for NewComePeople - operationId: NewComePeople.CreateRefTrips + - NewComePeople.Trips.PlanItem + summary: Create new navigation property ref to PlanItems for NewComePeople + operationId: NewComePeople.Trips.CreateRefPlanItems parameters: - name: UserName in: path @@ -2370,6 +2613,16 @@ paths: schema: type: string x-ms-docs-key-type: Person + - name: TripId + in: path + description: 'key: TripId of Trip' + required: true + schema: + maximum: 2147483647 + minimum: -2147483648 + type: integer + format: int32 + x-ms-docs-key-type: Trip requestBody: description: New navigation property ref value content: @@ -2770,115 +3023,7 @@ paths: tags: - People.Person summary: Get Friends from People - operationId: People.ListFriends - parameters: - - name: UserName - in: path - description: 'key: UserName of Person' - required: true - schema: - type: string - x-ms-docs-key-type: Person - - $ref: '#/components/parameters/top' - - $ref: '#/components/parameters/skip' - - $ref: '#/components/parameters/search' - - $ref: '#/components/parameters/filter' - - $ref: '#/components/parameters/count' - - name: $orderby - in: query - description: Order items by property values - style: form - explode: false - schema: - uniqueItems: true - type: array - items: - enum: - - UserName - - UserName desc - - FirstName - - FirstName desc - - LastName - - LastName desc - - MiddleName - - MiddleName desc - - Gender - - Gender desc - - Age - - Age desc - - Emails - - Emails desc - - AddressInfo - - AddressInfo desc - - HomeAddress - - HomeAddress desc - - FavoriteFeature - - FavoriteFeature desc - - Features - - Features desc - type: string - - name: $select - in: query - description: Select properties to be returned - style: form - explode: false - schema: - uniqueItems: true - type: array - items: - enum: - - UserName - - FirstName - - LastName - - MiddleName - - Gender - - Age - - Emails - - AddressInfo - - HomeAddress - - FavoriteFeature - - Features - - Friends - - BestFriend - - Trips - type: string - - name: $expand - in: query - description: Expand related entities - style: form - explode: false - schema: - uniqueItems: true - type: array - items: - enum: - - '*' - - Friends - - BestFriend - - Trips - type: string - responses: - '200': - description: Retrieved navigation property - content: - application/json: - schema: - title: Collection of Person - type: object - properties: - value: - type: array - items: - $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person' - default: - $ref: '#/components/responses/error' - x-ms-docs-operation-type: operation - '/People/{UserName}/Friends/{UserName1}': - get: - tags: - - People.Person - summary: Get Friends from People - operationId: People.GetFriends + operationId: People.ListFriends parameters: - name: UserName in: path @@ -2887,13 +3032,44 @@ paths: schema: type: string x-ms-docs-key-type: Person - - name: UserName1 - in: path - description: 'key: UserName of Person' - required: true + - $ref: '#/components/parameters/top' + - $ref: '#/components/parameters/skip' + - $ref: '#/components/parameters/search' + - $ref: '#/components/parameters/filter' + - $ref: '#/components/parameters/count' + - name: $orderby + in: query + description: Order items by property values + style: form + explode: false schema: - type: string - x-ms-docs-key-type: Person + uniqueItems: true + type: array + items: + enum: + - UserName + - UserName desc + - FirstName + - FirstName desc + - LastName + - LastName desc + - MiddleName + - MiddleName desc + - Gender + - Gender desc + - Age + - Age desc + - Emails + - Emails desc + - AddressInfo + - AddressInfo desc + - HomeAddress + - HomeAddress desc + - FavoriteFeature + - FavoriteFeature desc + - Features + - Features desc + type: string - name: $select in: query description: Select properties to be returned @@ -2940,7 +3116,13 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person' + title: Collection of Person + type: object + properties: + value: + type: array + items: + $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person' default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation @@ -3306,6 +3488,36 @@ paths: default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation + post: + tags: + - People.Trip + summary: Create new navigation property to Trips for People + operationId: People.CreateTrips + parameters: + - name: UserName + in: path + description: 'key: UserName of Person' + required: true + schema: + type: string + x-ms-docs-key-type: Person + requestBody: + description: New navigation property + content: + application/json: + schema: + $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip' + required: true + responses: + '201': + description: Created navigation property. + content: + application/json: + schema: + $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip' + default: + $ref: '#/components/responses/error' + x-ms-docs-operation-type: operation '/People/{UserName}/Trips/{TripId}': get: tags: @@ -3373,6 +3585,76 @@ paths: default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation + patch: + tags: + - People.Trip + summary: Update the navigation property Trips in People + operationId: People.UpdateTrips + parameters: + - name: UserName + in: path + description: 'key: UserName of Person' + required: true + schema: + type: string + x-ms-docs-key-type: Person + - name: TripId + in: path + description: 'key: TripId of Trip' + required: true + schema: + maximum: 2147483647 + minimum: -2147483648 + type: integer + format: int32 + x-ms-docs-key-type: Trip + requestBody: + description: New navigation property values + content: + application/json: + schema: + $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip' + required: true + responses: + '204': + description: Success + default: + $ref: '#/components/responses/error' + x-ms-docs-operation-type: operation + delete: + tags: + - People.Trip + summary: Delete navigation property Trips for People + operationId: People.DeleteTrips + parameters: + - name: UserName + in: path + description: 'key: UserName of Person' + required: true + schema: + type: string + x-ms-docs-key-type: Person + - name: TripId + in: path + description: 'key: TripId of Trip' + required: true + schema: + maximum: 2147483647 + minimum: -2147483648 + type: integer + format: int32 + x-ms-docs-key-type: Trip + - name: If-Match + in: header + description: ETag + schema: + type: string + responses: + '204': + description: Success + default: + $ref: '#/components/responses/error' + x-ms-docs-operation-type: operation '/People/{UserName}/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()': get: tags: @@ -3411,12 +3693,12 @@ paths: default: $ref: '#/components/responses/error' x-ms-docs-operation-type: function - '/People/{UserName}/Trips/$ref': + '/People/{UserName}/Trips/{TripId}/PlanItems': get: tags: - - People.Trip - summary: Get ref of Trips from People - operationId: People.ListRefTrips + - People.Trips.PlanItem + summary: Get PlanItems from People + operationId: People.Trips.ListPlanItems parameters: - name: UserName in: path @@ -3425,6 +3707,16 @@ paths: schema: type: string x-ms-docs-key-type: Person + - name: TripId + in: path + description: 'key: TripId of Trip' + required: true + schema: + maximum: 2147483647 + minimum: -2147483648 + type: integer + format: int32 + x-ms-docs-key-type: Trip - $ref: '#/components/parameters/top' - $ref: '#/components/parameters/skip' - $ref: '#/components/parameters/search' @@ -3440,22 +3732,110 @@ paths: type: array items: enum: - - TripId - - TripId desc - - ShareId - - ShareId desc - - Name - - Name desc - - Budget - - Budget desc - - Description - - Description desc - - Tags - - Tags desc + - PlanItemId + - PlanItemId desc + - ConfirmationCode + - ConfirmationCode desc + - StartsAt + - StartsAt desc + - EndsAt + - EndsAt desc + - Duration + - Duration desc + type: string + - name: $select + in: query + description: Select properties to be returned + style: form + explode: false + schema: + uniqueItems: true + type: array + items: + enum: + - PlanItemId + - ConfirmationCode + - StartsAt + - EndsAt + - Duration + type: string + - name: $expand + in: query + description: Expand related entities + style: form + explode: false + schema: + uniqueItems: true + type: array + items: + enum: + - '*' + type: string + responses: + '200': + description: Retrieved navigation property + content: + application/json: + schema: + title: Collection of PlanItem + type: object + properties: + value: + type: array + items: + $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.PlanItem' + default: + $ref: '#/components/responses/error' + x-ms-docs-operation-type: operation + '/People/{UserName}/Trips/{TripId}/PlanItems/$ref': + get: + tags: + - People.Trips.PlanItem + summary: Get ref of PlanItems from People + operationId: People.Trips.ListRefPlanItems + parameters: + - name: UserName + in: path + description: 'key: UserName of Person' + required: true + schema: + type: string + x-ms-docs-key-type: Person + - name: TripId + in: path + description: 'key: TripId of Trip' + required: true + schema: + maximum: 2147483647 + minimum: -2147483648 + type: integer + format: int32 + x-ms-docs-key-type: Trip + - $ref: '#/components/parameters/top' + - $ref: '#/components/parameters/skip' + - $ref: '#/components/parameters/search' + - $ref: '#/components/parameters/filter' + - $ref: '#/components/parameters/count' + - name: $orderby + in: query + description: Order items by property values + style: form + explode: false + schema: + uniqueItems: true + type: array + items: + enum: + - PlanItemId + - PlanItemId desc + - ConfirmationCode + - ConfirmationCode desc - StartsAt - StartsAt desc - EndsAt - EndsAt desc + - Duration + - Duration desc type: string responses: '200': @@ -3463,7 +3843,7 @@ paths: content: application/json: schema: - title: Collection of links of Trip + title: Collection of links of PlanItem type: object properties: value: @@ -3475,9 +3855,9 @@ paths: x-ms-docs-operation-type: operation post: tags: - - People.Trip - summary: Create new navigation property ref to Trips for People - operationId: People.CreateRefTrips + - People.Trips.PlanItem + summary: Create new navigation property ref to PlanItems for People + operationId: People.Trips.CreateRefPlanItems parameters: - name: UserName in: path @@ -3486,6 +3866,16 @@ paths: schema: type: string x-ms-docs-key-type: Person + - name: TripId + in: path + description: 'key: TripId of Trip' + required: true + schema: + maximum: 2147483647 + minimum: -2147483648 + type: integer + format: int32 + x-ms-docs-key-type: Trip requestBody: description: New navigation property ref value content: @@ -4136,6 +4526,8 @@ tags: x-ms-docs-toc-type: container - name: Me.Trip x-ms-docs-toc-type: page + - name: Me.Trips.PlanItem + x-ms-docs-toc-type: page - name: NewComePeople.Person x-ms-docs-toc-type: page - name: NewComePeople.Functions @@ -4144,6 +4536,8 @@ tags: x-ms-docs-toc-type: container - name: NewComePeople.Trip x-ms-docs-toc-type: page + - name: NewComePeople.Trips.PlanItem + x-ms-docs-toc-type: page - name: People.Person x-ms-docs-toc-type: page - name: People.Functions @@ -4152,5 +4546,7 @@ tags: x-ms-docs-toc-type: container - name: People.Trip x-ms-docs-toc-type: page + - name: People.Trips.PlanItem + x-ms-docs-toc-type: page - name: ResetDataSource x-ms-docs-toc-type: container \ No newline at end of file From 08c9359239fb6c96aee010767ef84897692a2a91 Mon Sep 17 00:00:00 2001 From: Darrel Miller Date: Tue, 25 Aug 2020 19:12:41 -0400 Subject: [PATCH 4/5] Fixed test --- .../Edm/ODataPathProviderTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Edm/ODataPathProviderTests.cs b/test/Microsoft.OpenAPI.OData.Reader.Tests/Edm/ODataPathProviderTests.cs index 246f5184..a740a7d9 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Edm/ODataPathProviderTests.cs +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Edm/ODataPathProviderTests.cs @@ -44,7 +44,7 @@ public void GetPathsForGraphBetaModelReturnsAllPaths() // Assert Assert.NotNull(paths); - Assert.Equal(4455, paths.Count()); + Assert.Equal(4457, paths.Count()); } [Fact] From cffaa6ddb34a7233a0280d03f1e3582cfe09b6a8 Mon Sep 17 00:00:00 2001 From: Darrel Miller Date: Fri, 28 Aug 2020 15:32:20 -0400 Subject: [PATCH 5/5] Updates based on review --- src/Microsoft.OpenApi.OData.Reader/Edm/ODataPathProvider.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/Edm/ODataPathProvider.cs b/src/Microsoft.OpenApi.OData.Reader/Edm/ODataPathProvider.cs index ff7415c1..18c1791e 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Edm/ODataPathProvider.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Edm/ODataPathProvider.cs @@ -244,7 +244,6 @@ private void RetrieveNavigationPropertyPaths(IEdmNavigationProperty navigationPr // append a navigation property. currentPath.Push(new ODataNavigationPropertySegment(navigationProperty)); AppendPath(currentPath.Clone()); - IEdmEntityType navEntityType = navigationProperty.ToEntityType(); if (!navigationProperty.ContainsTarget) { @@ -257,6 +256,8 @@ private void RetrieveNavigationPropertyPaths(IEdmNavigationProperty navigationPr } else { + IEdmEntityType navEntityType = navigationProperty.ToEntityType(); + // append a navigation property key. if (navigationProperty.TargetMultiplicity() == EdmMultiplicity.Many) {