diff --git a/src/Microsoft.OpenApi.OData.Reader/Edm/ODataPathProvider.cs b/src/Microsoft.OpenApi.OData.Reader/Edm/ODataPathProvider.cs index a6b877b9..18c1791e 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Edm/ODataPathProvider.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Edm/ODataPathProvider.cs @@ -254,40 +254,41 @@ 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()); + IEdmEntityType navEntityType = navigationProperty.ToEntityType(); - 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(); } diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Edm/ODataPathProviderTests.cs b/test/Microsoft.OpenAPI.OData.Reader.Tests/Edm/ODataPathProviderTests.cs index df679253..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(4585, paths.Count()); + Assert.Equal(4457, paths.Count()); } [Fact] @@ -149,7 +149,7 @@ public void GetPathsWithUnboundOperationImportWorks() } [Fact] - public void GetPathsWithNavigationPropertytWorks() + public void GetPathsWithNonContainedNavigationPropertytWorks() { // Arrange string entityType = @@ -171,16 +171,45 @@ 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); + } + [Theory] [InlineData(true, "Logo")] [InlineData(false, "Logo")] 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.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 4928e181..9a316bc2 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": [ @@ -1641,6 +1554,40 @@ } }, "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}": { @@ -1724,6 +1671,87 @@ } }, "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()": { @@ -1774,14 +1802,27 @@ "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", "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" }, @@ -1808,22 +1849,54 @@ "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" + } + } + }, + { + "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" } @@ -1832,17 +1905,17 @@ ], "responses": { "200": { - "description": "Retrieved navigation property links", + "description": "Retrieved navigation property", "content": { "application/json": { "schema": { - "title": "Collection of links of Trip", + "title": "Collection of PlanItem", "type": "object", "properties": { "value": { "type": "array", "items": { - "type": "string" + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.PlanItem" } } } @@ -1855,13 +1928,118 @@ } }, "x-ms-docs-operation-type": "operation" - }, - "post": { + } + }, + "/Me/Trips/{TripId}/PlanItems/$ref": { + "get": { "tags": [ - "Me.Trip" + "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": { + "description": "Retrieved navigation property links", + "content": { + "application/json": { + "schema": { + "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" + } ], - "summary": "Create new navigation property ref to Trips for Me", - "operationId": "Me.CreateRefTrips", "requestBody": { "description": "New navigation property ref value", "content": { @@ -2579,103 +2757,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": [ @@ -3218,6 +3299,52 @@ } }, "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}": { @@ -3311,15 +3438,13 @@ } }, "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", + "summary": "Update the navigation property Trips in NewComePeople", + "operationId": "NewComePeople.UpdateTrips", "parameters": [ { "name": "UserName", @@ -3345,39 +3470,33 @@ "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": { - "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": "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", + "summary": "Delete navigation property Trips for NewComePeople", + "operationId": "NewComePeople.DeleteTrips", "parameters": [ { "name": "UserName", @@ -3390,85 +3509,45 @@ "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": "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", - "in": "query", - "description": "Order items by property values", - "style": "form", - "explode": false, + "name": "If-Match", + "in": "header", + "description": "ETag", "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" - } + "type": "string" } } ], "responses": { - "200": { - "description": "Retrieved navigation property links", - "content": { - "application/json": { - "schema": { - "title": "Collection of links of Trip", - "type": "object", - "properties": { - "value": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - } - } + "204": { + "description": "Success" }, "default": { "$ref": "#/components/responses/error" } }, "x-ms-docs-operation-type": "operation" - }, - "post": { + } + }, + "/NewComePeople/{UserName}/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()": { + "get": { "tags": [ - "NewComePeople.Trip" + "NewComePeople.Functions" ], - "summary": "Create new navigation property ref to Trips for NewComePeople", - "operationId": "NewComePeople.CreateRefTrips", + "summary": "Invoke function GetInvolvedPeople", + "operationId": "NewComePeople.Trips.GetInvolvedPeople", "parameters": [ { "name": "UserName", @@ -3479,29 +3558,36 @@ "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": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - }, - "required": true - }, "responses": { - "201": { - "description": "Created navigation property link.", + "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 + } } } } @@ -3510,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" }, @@ -3547,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" } @@ -3585,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" } @@ -3615,10 +3703,7 @@ "type": "array", "items": { "enum": [ - "*", - "Friends", - "BestFriend", - "Trips" + "*" ], "type": "string" } @@ -3627,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" } } } @@ -3648,95 +3733,60 @@ "default": { "$ref": "#/components/responses/error" } - } - }, - "post": { + }, + "x-ms-docs-operation-type": "operation" + } + }, + "/NewComePeople/{UserName}/Trips/{TripId}/PlanItems/$ref": { + "get": { "tags": [ - "People.Person" + "NewComePeople.Trips.PlanItem" ], - "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" - } - } + "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" }, - "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}": { - "get": { - "tags": [ - "People.Person" - ], - "summary": "Get entity from People by key", - "operationId": "People.Person.GetPerson", - "parameters": [ { - "name": "UserName", + "name": "TripId", "in": "path", - "description": "key: UserName of Person", + "description": "key: TripId of Trip", "required": true, "schema": { - "type": "string" + "maximum": 2147483647, + "minimum": -2147483648, + "type": "integer", + "format": "int32" }, - "x-ms-docs-key-type": "Person" + "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": [ - "UserName", - "FirstName", - "LastName", - "MiddleName", - "Gender", - "Age", - "Emails", - "AddressInfo", - "HomeAddress", - "FavoriteFeature", - "Features", - "Friends", - "BestFriend", - "Trips" - ], - "type": "string" - } - } + "$ref": "#/components/parameters/top" }, { - "name": "$expand", + "$ref": "#/components/parameters/skip" + }, + { + "$ref": "#/components/parameters/search" + }, + { + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/count" + }, + { + "name": "$orderby", "in": "query", - "description": "Expand related entities", + "description": "Order items by property values", "style": "form", "explode": false, "schema": { @@ -3744,10 +3794,16 @@ "type": "array", "items": { "enum": [ - "*", - "Friends", - "BestFriend", - "Trips" + "PlanItemId", + "PlanItemId desc", + "ConfirmationCode", + "ConfirmationCode desc", + "StartsAt", + "StartsAt desc", + "EndsAt", + "EndsAt desc", + "Duration", + "Duration desc" ], "type": "string" } @@ -3756,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" + } + } + } } } } @@ -3771,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", @@ -3787,58 +3852,45 @@ "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" - }, - "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" + "201": { + "description": "Created navigation property link.", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } } - } - ], - "responses": { - "204": { - "description": "Success" }, "default": { "$ref": "#/components/responses/error" @@ -3847,23 +3899,66 @@ "x-ms-docs-operation-type": "operation" } }, - "/People/{UserName}/BestFriend": { + "/People": { "get": { "tags": [ "People.Person" ], - "summary": "Get BestFriend from People", - "operationId": "People.GetBestFriend", + "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": "$select", @@ -3918,11 +4013,20 @@ ], "responses": { "200": { - "description": "Retrieved navigation property", + "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" + } + } + } } } } @@ -3930,17 +4034,50 @@ "default": { "$ref": "#/components/responses/error" } - }, - "x-ms-docs-operation-type": "operation" - } - }, - "/People/{UserName}/BestFriend/$ref": { - "get": { + } + }, + "post": { "tags": [ "People.Person" ], - "summary": "Get ref of BestFriend from People", - "operationId": "People.GetRefBestFriend", + "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}": { + "get": { + "tags": [ + "People.Person" + ], + "summary": "Get entity from People by key", + "operationId": "People.Person.GetPerson", "parameters": [ { "name": "UserName", @@ -3951,15 +4088,65 @@ "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 link", + "description": "Retrieved entity", "content": { "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person" } } } @@ -3970,12 +4157,12 @@ }, "x-ms-docs-operation-type": "operation" }, - "put": { + "patch": { "tags": [ "People.Person" ], - "summary": "Update the ref of navigation property BestFriend in People", - "operationId": "People.UpdateRefBestFriend", + "summary": "Update entity in People", + "operationId": "People.Person.UpdatePerson", "parameters": [ { "name": "UserName", @@ -3989,14 +4176,11 @@ } ], "requestBody": { - "description": "New navigation property ref values", + "description": "New property values", "content": { "application/json": { "schema": { - "type": "object", - "additionalProperties": { - "type": "object" - } + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person" } } }, @@ -4016,8 +4200,8 @@ "tags": [ "People.Person" ], - "summary": "Delete ref of navigation property BestFriend for People", - "operationId": "People.DeleteRefBestFriend", + "summary": "Delete entity from People", + "operationId": "People.Person.DeletePerson", "parameters": [ { "name": "UserName", @@ -4049,13 +4233,13 @@ "x-ms-docs-operation-type": "operation" } }, - "/People/{UserName}/Friends": { + "/People/{UserName}/BestFriend": { "get": { "tags": [ "People.Person" ], - "summary": "Get Friends from People", - "operationId": "People.ListFriends", + "summary": "Get BestFriend from People", + "operationId": "People.GetBestFriend", "parameters": [ { "name": "UserName", @@ -4067,59 +4251,6 @@ }, "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", @@ -4177,16 +4308,7 @@ "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" - } - } - } + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person" } } } @@ -4198,13 +4320,13 @@ "x-ms-docs-operation-type": "operation" } }, - "/People/{UserName}/Friends/{UserName1}": { + "/People/{UserName}/BestFriend/$ref": { "get": { "tags": [ "People.Person" ], - "summary": "Get Friends from People", - "operationId": "People.GetFriends", + "summary": "Get ref of BestFriend from People", + "operationId": "People.GetRefBestFriend", "parameters": [ { "name": "UserName", @@ -4215,75 +4337,15 @@ "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", + "description": "Retrieved navigation property link", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Person" + "type": "string" } } } @@ -4293,15 +4355,650 @@ } }, "x-ms-docs-operation-type": "operation" - } - }, - "/People/{UserName}/Friends/$ref": { - "get": { + }, + "put": { "tags": [ "People.Person" ], - "summary": "Get ref of Friends from People", - "operationId": "People.ListRefFriends", + "summary": "Update the ref of navigation property BestFriend in People", + "operationId": "People.UpdateRefBestFriend", + "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 ref values", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Success" + }, + "default": { + "$ref": "#/components/responses/error" + } + }, + "x-ms-docs-operation-type": "operation" + }, + "delete": { + "tags": [ + "People.Person" + ], + "summary": "Delete ref of navigation property BestFriend for People", + "operationId": "People.DeleteRefBestFriend", + "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}/Friends": { + "get": { + "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/$ref": { + "get": { + "tags": [ + "People.Person" + ], + "summary": "Get ref of Friends from People", + "operationId": "People.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", + "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" + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved navigation property links", + "content": { + "application/json": { + "schema": { + "title": "Collection of links of Person", + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + }, + "default": { + "$ref": "#/components/responses/error" + } + }, + "x-ms-docs-operation-type": "operation" + }, + "post": { + "tags": [ + "People.Person" + ], + "summary": "Create new navigation property ref to Friends for People", + "operationId": "People.CreateRefFriends", + "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 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" + } + } + } + }, + "default": { + "$ref": "#/components/responses/error" + } + }, + "x-ms-docs-operation-type": "operation" + } + }, + "/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFavoriteAirline()": { + "get": { + "tags": [ + "People.Functions" + ], + "summary": "Invoke function GetFavoriteAirline", + "operationId": "People.GetFavoriteAirline", + "parameters": [ + { + "name": "UserName", + "in": "path", + "description": "key: UserName of Person", + "required": true, + "schema": { + "type": "string" + }, + "x-ms-docs-key-type": "Person" + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Airline" + } + ], + "nullable": true + } + } + } + }, + "default": { + "$ref": "#/components/responses/error" + } + }, + "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", @@ -4331,7 +5028,64 @@ { "name": "$orderby", "in": "query", - "description": "Order items by property values", + "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": { @@ -4339,28 +5093,8 @@ "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" + "*", + "PlanItems" ], "type": "string" } @@ -4369,17 +5103,17 @@ ], "responses": { "200": { - "description": "Retrieved navigation property links", + "description": "Retrieved navigation property", "content": { "application/json": { "schema": { - "title": "Collection of links of Person", + "title": "Collection of Trip", "type": "object", "properties": { "value": { "type": "array", "items": { - "type": "string" + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip" } } } @@ -4395,10 +5129,10 @@ }, "post": { "tags": [ - "People.Person" + "People.Trip" ], - "summary": "Create new navigation property ref to Friends for People", - "operationId": "People.CreateRefFriends", + "summary": "Create new navigation property to Trips for People", + "operationId": "People.CreateTrips", "parameters": [ { "name": "UserName", @@ -4412,14 +5146,11 @@ } ], "requestBody": { - "description": "New navigation property ref value", + "description": "New navigation property", "content": { "application/json": { "schema": { - "type": "object", - "additionalProperties": { - "type": "object" - } + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip" } } }, @@ -4427,11 +5158,11 @@ }, "responses": { "201": { - "description": "Created navigation property link.", + "description": "Created navigation property.", "content": { "application/json": { "schema": { - "type": "object" + "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Trip" } } } @@ -4443,13 +5174,13 @@ "x-ms-docs-operation-type": "operation" } }, - "/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFavoriteAirline()": { + "/People/{UserName}/Trips/{TripId}": { "get": { "tags": [ - "People.Functions" + "People.Trip" ], - "summary": "Invoke function GetFavoriteAirline", - "operationId": "People.GetFavoriteAirline", + "summary": "Get Trips from People", + "operationId": "People.GetTrips", "parameters": [ { "name": "UserName", @@ -4460,73 +5191,71 @@ "type": "string" }, "x-ms-docs-key-type": "Person" - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Airline" - } - ], - "nullable": true - } - } - } }, - "default": { - "$ref": "#/components/responses/error" - } - }, - "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", + "name": "TripId", "in": "path", - "description": "key: UserName of Person", + "description": "key: TripId of Trip", "required": true, "schema": { - "type": "string" + "maximum": 2147483647, + "minimum": -2147483648, + "type": "integer", + "format": "int32" }, - "x-ms-docs-key-type": "Person" + "x-ms-docs-key-type": "Trip" }, { - "name": "userName", - "in": "path", - "required": true, + "name": "$select", + "in": "query", + "description": "Select properties to be returned", + "style": "form", + "explode": false, "schema": { - "type": "string" + "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" } } } @@ -4535,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", @@ -4555,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", @@ -4622,30 +5334,29 @@ "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" - } - } - } + }, + { + "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" } - }, - "required": true - }, + } + ], "responses": { "204": { "description": "Success" @@ -4654,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", @@ -4676,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": { @@ -4690,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 + } } } } @@ -4703,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", @@ -4721,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" }, @@ -4747,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" } @@ -4779,15 +5509,11 @@ "type": "array", "items": { "enum": [ - "TripId", - "ShareId", - "Name", - "Budget", - "Description", - "Tags", + "PlanItemId", + "ConfirmationCode", "StartsAt", "EndsAt", - "PlanItems" + "Duration" ], "type": "string" } @@ -4804,8 +5530,7 @@ "type": "array", "items": { "enum": [ - "*", - "PlanItems" + "*" ], "type": "string" } @@ -4818,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" } } } @@ -4839,106 +5564,13 @@ "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()": { + "/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", "parameters": [ { "name": "UserName", @@ -4962,51 +5594,6 @@ "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": [ - "People.Trip" - ], - "summary": "Get ref of Trips from People", - "operationId": "People.ListRefTrips", - "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" @@ -5034,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" } @@ -5062,7 +5643,7 @@ "content": { "application/json": { "schema": { - "title": "Collection of links of Trip", + "title": "Collection of links of PlanItem", "type": "object", "properties": { "value": { @@ -5084,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", @@ -5098,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": { @@ -6155,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" @@ -6171,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" @@ -6187,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