diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.V2.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.V2.json index b9b87c7..e7c4786 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.V2.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.V2.json @@ -1,4 +1,4 @@ -{ +{ "swagger": "2.0", "info": { "title": "OData Service for namespace ", @@ -67,6 +67,10 @@ "type": "string" } } + }, + "ODataCountResponse": { + "format": "int32", + "type": "integer" } }, "parameters": { diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.V2.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.V2.yaml index c1586c9..b02a897 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.V2.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.V2.yaml @@ -1,4 +1,4 @@ -swagger: '2.0' +swagger: '2.0' info: title: 'OData Service for namespace ' description: This OData service is located at http://localhost @@ -46,6 +46,9 @@ definitions: type: string target: type: string + ODataCountResponse: + format: int32 + type: integer parameters: top: in: query diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.json index b7ace77..4c2bcc7 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.json @@ -1,4 +1,4 @@ -{ +{ "openapi": "3.0.1", "info": { "title": "OData Service for namespace ", @@ -69,6 +69,10 @@ "type": "string" } } + }, + "ODataCountResponse": { + "type": "integer", + "format": "int32" } }, "responses": { diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.yaml index 28eaf3e..04f3b17 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: 3.0.1 info: title: 'OData Service for namespace ' description: This OData service is located at http://localhost @@ -46,6 +46,9 @@ components: type: string target: type: string + ODataCountResponse: + type: integer + format: int32 responses: error: description: error 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 326eeb1..2c01342 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 @@ -1,4 +1,4 @@ -{ +{ "swagger": "2.0", "info": { "title": "OData Service for namespace Default", @@ -289,6 +289,26 @@ "x-ms-docs-operation-type": "operation" } }, + "/Categories/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.Categories", + "produces": [ + "text/plain" + ], + "responses": { + "200": { + "description": "The count of the resource", + "schema": { + "$ref": "#/definitions/ODataCountResponse" + } + }, + "default": { + "$ref": "#/responses/error" + } + } + } + }, "/Documents": { "get": { "tags": [ @@ -827,6 +847,39 @@ "x-ms-docs-operation-type": "operation" } }, + "/Documents({Id})/Revisions/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.Revisions", + "produces": [ + "text/plain" + ], + "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" + } + ], + "responses": { + "200": { + "description": "The count of the resource", + "schema": { + "$ref": "#/definitions/ODataCountResponse" + } + }, + "default": { + "$ref": "#/responses/error" + } + } + } + }, "/Documents({Id})/Revisions/$ref": { "get": { "tags": [ @@ -983,6 +1036,26 @@ "x-ms-docs-operation-type": "operation" } }, + "/Documents/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.Documents", + "produces": [ + "text/plain" + ], + "responses": { + "200": { + "description": "The count of the resource", + "schema": { + "$ref": "#/definitions/ODataCountResponse" + } + }, + "default": { + "$ref": "#/responses/error" + } + } + } + }, "/Libraries": { "get": { "tags": [ @@ -1483,6 +1556,39 @@ "x-ms-docs-operation-type": "operation" } }, + "/Libraries({Id})/Documents/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.Documents", + "produces": [ + "text/plain" + ], + "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" + } + ], + "responses": { + "200": { + "description": "The count of the resource", + "schema": { + "$ref": "#/definitions/ODataCountResponse" + } + }, + "default": { + "$ref": "#/responses/error" + } + } + } + }, "/Libraries({Id})/Documents/$ref": { "get": { "tags": [ @@ -1625,6 +1731,26 @@ "x-ms-docs-operation-type": "operation" } }, + "/Libraries/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.Libraries", + "produces": [ + "text/plain" + ], + "responses": { + "200": { + "description": "The count of the resource", + "schema": { + "$ref": "#/definitions/ODataCountResponse" + } + }, + "default": { + "$ref": "#/responses/error" + } + } + } + }, "/Revisions": { "get": { "tags": [ @@ -2184,6 +2310,26 @@ "x-ms-docs-operation-type": "operation" } }, + "/Revisions/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.Revisions", + "produces": [ + "text/plain" + ], + "responses": { + "200": { + "description": "The count of the resource", + "schema": { + "$ref": "#/definitions/ODataCountResponse" + } + }, + "default": { + "$ref": "#/responses/error" + } + } + } + }, "/Tasks": { "get": { "tags": [ @@ -2722,6 +2868,39 @@ "x-ms-docs-operation-type": "operation" } }, + "/Tasks({Id})/Revisions/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.Revisions", + "produces": [ + "text/plain" + ], + "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" + } + ], + "responses": { + "200": { + "description": "The count of the resource", + "schema": { + "$ref": "#/definitions/ODataCountResponse" + } + }, + "default": { + "$ref": "#/responses/error" + } + } + } + }, "/Tasks({Id})/Revisions/$ref": { "get": { "tags": [ @@ -2877,6 +3056,26 @@ }, "x-ms-docs-operation-type": "operation" } + }, + "/Tasks/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.Tasks", + "produces": [ + "text/plain" + ], + "responses": { + "200": { + "description": "The count of the resource", + "schema": { + "$ref": "#/definitions/ODataCountResponse" + } + }, + "default": { + "$ref": "#/responses/error" + } + } + } } }, "definitions": { @@ -4637,6 +4836,10 @@ "type": "string" } } + }, + "ODataCountResponse": { + "format": "int32", + "type": "integer" } }, "parameters": { 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 4275c6d..2eaef7d 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 @@ -1,4 +1,4 @@ -swagger: '2.0' +swagger: '2.0' info: title: OData Service for namespace Default description: This OData service is located at http://localhost @@ -199,6 +199,19 @@ paths: default: $ref: '#/responses/error' x-ms-docs-operation-type: operation + /Categories/$count: + get: + summary: Get the number of the resource + operationId: Get.Count.Categories + produces: + - text/plain + responses: + '200': + description: The count of the resource + schema: + $ref: '#/definitions/ODataCountResponse' + default: + $ref: '#/responses/error' /Documents: get: tags: @@ -588,6 +601,29 @@ paths: default: $ref: '#/responses/error' x-ms-docs-operation-type: operation + '/Documents({Id})/Revisions/$count': + get: + summary: Get the number of the resource + operationId: Get.Count.Revisions + produces: + - text/plain + 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 + responses: + '200': + description: The count of the resource + schema: + $ref: '#/definitions/ODataCountResponse' + default: + $ref: '#/responses/error' '/Documents({Id})/Revisions/$ref': get: tags: @@ -701,6 +737,19 @@ paths: default: $ref: '#/responses/error' x-ms-docs-operation-type: operation + /Documents/$count: + get: + summary: Get the number of the resource + operationId: Get.Count.Documents + produces: + - text/plain + responses: + '200': + description: The count of the resource + schema: + $ref: '#/definitions/ODataCountResponse' + default: + $ref: '#/responses/error' /Libraries: get: tags: @@ -1063,6 +1112,29 @@ paths: default: $ref: '#/responses/error' x-ms-docs-operation-type: operation + '/Libraries({Id})/Documents/$count': + get: + summary: Get the number of the resource + operationId: Get.Count.Documents + produces: + - text/plain + 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 + responses: + '200': + description: The count of the resource + schema: + $ref: '#/definitions/ODataCountResponse' + default: + $ref: '#/responses/error' '/Libraries({Id})/Documents/$ref': get: tags: @@ -1162,6 +1234,19 @@ paths: default: $ref: '#/responses/error' x-ms-docs-operation-type: operation + /Libraries/$count: + get: + summary: Get the number of the resource + operationId: Get.Count.Libraries + produces: + - text/plain + responses: + '200': + description: The count of the resource + schema: + $ref: '#/definitions/ODataCountResponse' + default: + $ref: '#/responses/error' /Revisions: get: tags: @@ -1581,6 +1666,19 @@ paths: default: $ref: '#/responses/error' x-ms-docs-operation-type: operation + /Revisions/$count: + get: + summary: Get the number of the resource + operationId: Get.Count.Revisions + produces: + - text/plain + responses: + '200': + description: The count of the resource + schema: + $ref: '#/definitions/ODataCountResponse' + default: + $ref: '#/responses/error' /Tasks: get: tags: @@ -1970,6 +2068,29 @@ paths: default: $ref: '#/responses/error' x-ms-docs-operation-type: operation + '/Tasks({Id})/Revisions/$count': + get: + summary: Get the number of the resource + operationId: Get.Count.Revisions + produces: + - text/plain + 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 + responses: + '200': + description: The count of the resource + schema: + $ref: '#/definitions/ODataCountResponse' + default: + $ref: '#/responses/error' '/Tasks({Id})/Revisions/$ref': get: tags: @@ -2083,6 +2204,19 @@ paths: default: $ref: '#/responses/error' x-ms-docs-operation-type: operation + /Tasks/$count: + get: + summary: Get the number of the resource + operationId: Get.Count.Tasks + produces: + - text/plain + responses: + '200': + description: The count of the resource + schema: + $ref: '#/definitions/ODataCountResponse' + default: + $ref: '#/responses/error' definitions: Siterra.Documents.App.DTO.DocumentDto: title: DocumentDto @@ -3439,6 +3573,9 @@ definitions: type: string target: type: string + ODataCountResponse: + format: int32 + type: integer parameters: top: in: query 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 383ef8e..6d77ca6 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 @@ -1,4 +1,4 @@ -{ +{ "openapi": "3.0.1", "info": { "title": "OData Service for namespace Default", @@ -322,6 +322,27 @@ "x-ms-docs-operation-type": "operation" } }, + "/Categories/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.Categories", + "responses": { + "200": { + "description": "The count of the resource", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ODataCountResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/error" + } + } + } + }, "/Documents": { "get": { "tags": [ @@ -929,6 +950,42 @@ "x-ms-docs-operation-type": "operation" } }, + "/Documents({Id})/Revisions/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.Revisions", + "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" + } + ], + "responses": { + "200": { + "description": "The count of the resource", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ODataCountResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/error" + } + } + } + }, "/Documents({Id})/Revisions/$ref": { "get": { "tags": [ @@ -1095,6 +1152,27 @@ "x-ms-docs-operation-type": "operation" } }, + "/Documents/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.Documents", + "responses": { + "200": { + "description": "The count of the resource", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ODataCountResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/error" + } + } + } + }, "/Libraries": { "get": { "tags": [ @@ -1661,6 +1739,42 @@ "x-ms-docs-operation-type": "operation" } }, + "/Libraries({Id})/Documents/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.Documents", + "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" + } + ], + "responses": { + "200": { + "description": "The count of the resource", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ODataCountResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/error" + } + } + } + }, "/Libraries({Id})/Documents/$ref": { "get": { "tags": [ @@ -1813,6 +1927,27 @@ "x-ms-docs-operation-type": "operation" } }, + "/Libraries/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.Libraries", + "responses": { + "200": { + "description": "The count of the resource", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ODataCountResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/error" + } + } + } + }, "/Revisions": { "get": { "tags": [ @@ -2497,6 +2632,27 @@ "x-ms-docs-operation-type": "operation" } }, + "/Revisions/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.Revisions", + "responses": { + "200": { + "description": "The count of the resource", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ODataCountResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/error" + } + } + } + }, "/Tasks": { "get": { "tags": [ @@ -3104,6 +3260,42 @@ "x-ms-docs-operation-type": "operation" } }, + "/Tasks({Id})/Revisions/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.Revisions", + "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" + } + ], + "responses": { + "200": { + "description": "The count of the resource", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ODataCountResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/error" + } + } + } + }, "/Tasks({Id})/Revisions/$ref": { "get": { "tags": [ @@ -3269,6 +3461,27 @@ }, "x-ms-docs-operation-type": "operation" } + }, + "/Tasks/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.Tasks", + "responses": { + "200": { + "description": "The count of the resource", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ODataCountResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/error" + } + } + } } }, "components": { @@ -5226,6 +5439,10 @@ "type": "string" } } + }, + "ODataCountResponse": { + "type": "integer", + "format": "int32" } }, "responses": { 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 7ceeab4..6e4807a 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 @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: 3.0.1 info: title: OData Service for namespace Default description: This OData service is located at http://localhost @@ -219,6 +219,19 @@ paths: default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation + /Categories/$count: + get: + summary: Get the number of the resource + operationId: Get.Count.Categories + responses: + '200': + description: The count of the resource + content: + text/plain: + schema: + $ref: '#/components/schemas/ODataCountResponse' + default: + $ref: '#/components/responses/error' /Documents: get: tags: @@ -652,6 +665,30 @@ paths: default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation + '/Documents({Id})/Revisions/$count': + get: + summary: Get the number of the resource + operationId: Get.Count.Revisions + 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 + responses: + '200': + description: The count of the resource + content: + text/plain: + schema: + $ref: '#/components/schemas/ODataCountResponse' + default: + $ref: '#/components/responses/error' '/Documents({Id})/Revisions/$ref': get: tags: @@ -770,6 +807,19 @@ paths: default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation + /Documents/$count: + get: + summary: Get the number of the resource + operationId: Get.Count.Documents + responses: + '200': + description: The count of the resource + content: + text/plain: + schema: + $ref: '#/components/schemas/ODataCountResponse' + default: + $ref: '#/components/responses/error' /Libraries: get: tags: @@ -1175,6 +1225,30 @@ paths: default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation + '/Libraries({Id})/Documents/$count': + get: + summary: Get the number of the resource + operationId: Get.Count.Documents + 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 + responses: + '200': + description: The count of the resource + content: + text/plain: + schema: + $ref: '#/components/schemas/ODataCountResponse' + default: + $ref: '#/components/responses/error' '/Libraries({Id})/Documents/$ref': get: tags: @@ -1279,6 +1353,19 @@ paths: default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation + /Libraries/$count: + get: + summary: Get the number of the resource + operationId: Get.Count.Libraries + responses: + '200': + description: The count of the resource + content: + text/plain: + schema: + $ref: '#/components/schemas/ODataCountResponse' + default: + $ref: '#/components/responses/error' /Revisions: get: tags: @@ -1778,6 +1865,19 @@ paths: default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation + /Revisions/$count: + get: + summary: Get the number of the resource + operationId: Get.Count.Revisions + responses: + '200': + description: The count of the resource + content: + text/plain: + schema: + $ref: '#/components/schemas/ODataCountResponse' + default: + $ref: '#/components/responses/error' /Tasks: get: tags: @@ -2211,6 +2311,30 @@ paths: default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation + '/Tasks({Id})/Revisions/$count': + get: + summary: Get the number of the resource + operationId: Get.Count.Revisions + 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 + responses: + '200': + description: The count of the resource + content: + text/plain: + schema: + $ref: '#/components/schemas/ODataCountResponse' + default: + $ref: '#/components/responses/error' '/Tasks({Id})/Revisions/$ref': get: tags: @@ -2329,6 +2453,19 @@ paths: default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation + /Tasks/$count: + get: + summary: Get the number of the resource + operationId: Get.Count.Tasks + responses: + '200': + description: The count of the resource + content: + text/plain: + schema: + $ref: '#/components/schemas/ODataCountResponse' + default: + $ref: '#/components/responses/error' components: schemas: Siterra.Documents.App.DTO.DocumentDto: @@ -3831,6 +3968,9 @@ components: type: string target: type: string + ODataCountResponse: + type: integer + format: int32 responses: error: description: error 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 7949025..31c8c74 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 @@ -1,4 +1,4 @@ -{ +{ "swagger": "2.0", "info": { "title": "OData Service for namespace Microsoft.OData.Service.Sample.TrippinInMemory.Models", @@ -265,6 +265,26 @@ "x-ms-docs-operation-type": "operation" } }, + "/Airlines/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.Airlines", + "produces": [ + "text/plain" + ], + "responses": { + "200": { + "description": "The count of the resource", + "schema": { + "$ref": "#/definitions/ODataCountResponse" + } + }, + "default": { + "$ref": "#/responses/error" + } + } + } + }, "/Airports": { "get": { "tags": [ @@ -527,6 +547,26 @@ "x-ms-docs-operation-type": "operation" } }, + "/Airports/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.Airports", + "produces": [ + "text/plain" + ], + "responses": { + "200": { + "description": "The count of the resource", + "schema": { + "$ref": "#/definitions/ODataCountResponse" + } + }, + "default": { + "$ref": "#/responses/error" + } + } + } + }, "/GetNearestAirport(lat={lat},lon={lon})": { "get": { "tags": [ @@ -1000,6 +1040,26 @@ "x-ms-docs-operation-type": "operation" } }, + "/Me/Friends/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.Friends", + "produces": [ + "text/plain" + ], + "responses": { + "200": { + "description": "The count of the resource", + "schema": { + "$ref": "#/definitions/ODataCountResponse" + } + }, + "default": { + "$ref": "#/responses/error" + } + } + } + }, "/Me/Friends/$ref": { "get": { "tags": [ @@ -1836,6 +1896,39 @@ "x-ms-docs-operation-type": "operation" } }, + "/Me/Trips/{TripId}/PlanItems/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.PlanItems", + "produces": [ + "text/plain" + ], + "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" + } + ], + "responses": { + "200": { + "description": "The count of the resource", + "schema": { + "$ref": "#/definitions/ODataCountResponse" + } + }, + "default": { + "$ref": "#/responses/error" + } + } + } + }, "/Me/Trips/{TripId}/PlanItems/$ref": { "get": { "tags": [ @@ -1968,6 +2061,26 @@ "x-ms-docs-operation-type": "operation" } }, + "/Me/Trips/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.Trips", + "produces": [ + "text/plain" + ], + "responses": { + "200": { + "description": "The count of the resource", + "schema": { + "$ref": "#/definitions/ODataCountResponse" + } + }, + "default": { + "$ref": "#/responses/error" + } + } + } + }, "/NewComePeople": { "get": { "tags": [ @@ -2634,6 +2747,36 @@ "x-ms-docs-operation-type": "operation" } }, + "/NewComePeople/{UserName}/Friends/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.Friends", + "produces": [ + "text/plain" + ], + "parameters": [ + { + "in": "path", + "name": "UserName", + "description": "key: UserName of Person", + "required": true, + "type": "string", + "x-ms-docs-key-type": "Person" + } + ], + "responses": { + "200": { + "description": "The count of the resource", + "schema": { + "$ref": "#/definitions/ODataCountResponse" + } + }, + "default": { + "$ref": "#/responses/error" + } + } + } + }, "/NewComePeople/{UserName}/Friends/$ref": { "get": { "tags": [ @@ -3592,6 +3735,47 @@ "x-ms-docs-operation-type": "operation" } }, + "/NewComePeople/{UserName}/Trips/{TripId}/PlanItems/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.PlanItems", + "produces": [ + "text/plain" + ], + "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": "The count of the resource", + "schema": { + "$ref": "#/definitions/ODataCountResponse" + } + }, + "default": { + "$ref": "#/responses/error" + } + } + } + }, "/NewComePeople/{UserName}/Trips/{TripId}/PlanItems/$ref": { "get": { "tags": [ @@ -3740,6 +3924,56 @@ "x-ms-docs-operation-type": "operation" } }, + "/NewComePeople/{UserName}/Trips/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.Trips", + "produces": [ + "text/plain" + ], + "parameters": [ + { + "in": "path", + "name": "UserName", + "description": "key: UserName of Person", + "required": true, + "type": "string", + "x-ms-docs-key-type": "Person" + } + ], + "responses": { + "200": { + "description": "The count of the resource", + "schema": { + "$ref": "#/definitions/ODataCountResponse" + } + }, + "default": { + "$ref": "#/responses/error" + } + } + } + }, + "/NewComePeople/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.NewComePeople", + "produces": [ + "text/plain" + ], + "responses": { + "200": { + "description": "The count of the resource", + "schema": { + "$ref": "#/definitions/ODataCountResponse" + } + }, + "default": { + "$ref": "#/responses/error" + } + } + } + }, "/People": { "get": { "tags": [ @@ -4406,6 +4640,36 @@ "x-ms-docs-operation-type": "operation" } }, + "/People/{UserName}/Friends/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.Friends", + "produces": [ + "text/plain" + ], + "parameters": [ + { + "in": "path", + "name": "UserName", + "description": "key: UserName of Person", + "required": true, + "type": "string", + "x-ms-docs-key-type": "Person" + } + ], + "responses": { + "200": { + "description": "The count of the resource", + "schema": { + "$ref": "#/definitions/ODataCountResponse" + } + }, + "default": { + "$ref": "#/responses/error" + } + } + } + }, "/People/{UserName}/Friends/$ref": { "get": { "tags": [ @@ -5364,6 +5628,47 @@ "x-ms-docs-operation-type": "operation" } }, + "/People/{UserName}/Trips/{TripId}/PlanItems/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.PlanItems", + "produces": [ + "text/plain" + ], + "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": "The count of the resource", + "schema": { + "$ref": "#/definitions/ODataCountResponse" + } + }, + "default": { + "$ref": "#/responses/error" + } + } + } + }, "/People/{UserName}/Trips/{TripId}/PlanItems/$ref": { "get": { "tags": [ @@ -5512,6 +5817,56 @@ "x-ms-docs-operation-type": "operation" } }, + "/People/{UserName}/Trips/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.Trips", + "produces": [ + "text/plain" + ], + "parameters": [ + { + "in": "path", + "name": "UserName", + "description": "key: UserName of Person", + "required": true, + "type": "string", + "x-ms-docs-key-type": "Person" + } + ], + "responses": { + "200": { + "description": "The count of the resource", + "schema": { + "$ref": "#/definitions/ODataCountResponse" + } + }, + "default": { + "$ref": "#/responses/error" + } + } + } + }, + "/People/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.People", + "produces": [ + "text/plain" + ], + "responses": { + "200": { + "description": "The count of the resource", + "schema": { + "$ref": "#/definitions/ODataCountResponse" + } + }, + "default": { + "$ref": "#/responses/error" + } + } + } + }, "/ResetDataSource": { "post": { "tags": [ @@ -6135,6 +6490,10 @@ "type": "string" } } + }, + "ODataCountResponse": { + "format": "int32", + "type": "integer" } }, "parameters": { 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 5a5533a..9f81cb6 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 @@ -1,4 +1,4 @@ -swagger: '2.0' +swagger: '2.0' info: title: OData Service for namespace Microsoft.OData.Service.Sample.TrippinInMemory.Models description: This OData service is located at http://services.odata.org/TrippinRESTierService @@ -175,6 +175,19 @@ paths: default: $ref: '#/responses/error' x-ms-docs-operation-type: operation + /Airlines/$count: + get: + summary: Get the number of the resource + operationId: Get.Count.Airlines + produces: + - text/plain + responses: + '200': + description: The count of the resource + schema: + $ref: '#/definitions/ODataCountResponse' + default: + $ref: '#/responses/error' /Airports: get: tags: @@ -350,6 +363,19 @@ paths: default: $ref: '#/responses/error' x-ms-docs-operation-type: operation + /Airports/$count: + get: + summary: Get the number of the resource + operationId: Get.Count.Airports + produces: + - text/plain + responses: + '200': + description: The count of the resource + schema: + $ref: '#/definitions/ODataCountResponse' + default: + $ref: '#/responses/error' '/GetNearestAirport(lat={lat},lon={lon})': get: tags: @@ -684,6 +710,19 @@ paths: default: $ref: '#/responses/error' x-ms-docs-operation-type: operation + /Me/Friends/$count: + get: + summary: Get the number of the resource + operationId: Get.Count.Friends + produces: + - text/plain + responses: + '200': + description: The count of the resource + schema: + $ref: '#/definitions/ODataCountResponse' + default: + $ref: '#/responses/error' /Me/Friends/$ref: get: tags: @@ -1261,6 +1300,29 @@ paths: default: $ref: '#/responses/error' x-ms-docs-operation-type: operation + '/Me/Trips/{TripId}/PlanItems/$count': + get: + summary: Get the number of the resource + operationId: Get.Count.PlanItems + produces: + - text/plain + 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 + responses: + '200': + description: The count of the resource + schema: + $ref: '#/definitions/ODataCountResponse' + default: + $ref: '#/responses/error' '/Me/Trips/{TripId}/PlanItems/$ref': get: tags: @@ -1350,6 +1412,19 @@ paths: default: $ref: '#/responses/error' x-ms-docs-operation-type: operation + /Me/Trips/$count: + get: + summary: Get the number of the resource + operationId: Get.Count.Trips + produces: + - text/plain + responses: + '200': + description: The count of the resource + schema: + $ref: '#/definitions/ODataCountResponse' + default: + $ref: '#/responses/error' /NewComePeople: get: tags: @@ -1825,6 +1900,26 @@ paths: default: $ref: '#/responses/error' x-ms-docs-operation-type: operation + '/NewComePeople/{UserName}/Friends/$count': + get: + summary: Get the number of the resource + operationId: Get.Count.Friends + produces: + - text/plain + parameters: + - in: path + name: UserName + description: 'key: UserName of Person' + required: true + type: string + x-ms-docs-key-type: Person + responses: + '200': + description: The count of the resource + schema: + $ref: '#/definitions/ODataCountResponse' + default: + $ref: '#/responses/error' '/NewComePeople/{UserName}/Friends/$ref': get: tags: @@ -2493,6 +2588,35 @@ paths: default: $ref: '#/responses/error' x-ms-docs-operation-type: operation + '/NewComePeople/{UserName}/Trips/{TripId}/PlanItems/$count': + get: + summary: Get the number of the resource + operationId: Get.Count.PlanItems + produces: + - text/plain + 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: The count of the resource + schema: + $ref: '#/definitions/ODataCountResponse' + default: + $ref: '#/responses/error' '/NewComePeople/{UserName}/Trips/{TripId}/PlanItems/$ref': get: tags: @@ -2594,6 +2718,39 @@ paths: default: $ref: '#/responses/error' x-ms-docs-operation-type: operation + '/NewComePeople/{UserName}/Trips/$count': + get: + summary: Get the number of the resource + operationId: Get.Count.Trips + produces: + - text/plain + parameters: + - in: path + name: UserName + description: 'key: UserName of Person' + required: true + type: string + x-ms-docs-key-type: Person + responses: + '200': + description: The count of the resource + schema: + $ref: '#/definitions/ODataCountResponse' + default: + $ref: '#/responses/error' + /NewComePeople/$count: + get: + summary: Get the number of the resource + operationId: Get.Count.NewComePeople + produces: + - text/plain + responses: + '200': + description: The count of the resource + schema: + $ref: '#/definitions/ODataCountResponse' + default: + $ref: '#/responses/error' /People: get: tags: @@ -3069,6 +3226,26 @@ paths: default: $ref: '#/responses/error' x-ms-docs-operation-type: operation + '/People/{UserName}/Friends/$count': + get: + summary: Get the number of the resource + operationId: Get.Count.Friends + produces: + - text/plain + parameters: + - in: path + name: UserName + description: 'key: UserName of Person' + required: true + type: string + x-ms-docs-key-type: Person + responses: + '200': + description: The count of the resource + schema: + $ref: '#/definitions/ODataCountResponse' + default: + $ref: '#/responses/error' '/People/{UserName}/Friends/$ref': get: tags: @@ -3737,6 +3914,35 @@ paths: default: $ref: '#/responses/error' x-ms-docs-operation-type: operation + '/People/{UserName}/Trips/{TripId}/PlanItems/$count': + get: + summary: Get the number of the resource + operationId: Get.Count.PlanItems + produces: + - text/plain + 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: The count of the resource + schema: + $ref: '#/definitions/ODataCountResponse' + default: + $ref: '#/responses/error' '/People/{UserName}/Trips/{TripId}/PlanItems/$ref': get: tags: @@ -3838,6 +4044,39 @@ paths: default: $ref: '#/responses/error' x-ms-docs-operation-type: operation + '/People/{UserName}/Trips/$count': + get: + summary: Get the number of the resource + operationId: Get.Count.Trips + produces: + - text/plain + parameters: + - in: path + name: UserName + description: 'key: UserName of Person' + required: true + type: string + x-ms-docs-key-type: Person + responses: + '200': + description: The count of the resource + schema: + $ref: '#/definitions/ODataCountResponse' + default: + $ref: '#/responses/error' + /People/$count: + get: + summary: Get the number of the resource + operationId: Get.Count.People + produces: + - text/plain + responses: + '200': + description: The count of the resource + schema: + $ref: '#/definitions/ODataCountResponse' + default: + $ref: '#/responses/error' /ResetDataSource: post: tags: @@ -4244,6 +4483,9 @@ definitions: type: string target: type: string + ODataCountResponse: + format: int32 + type: integer parameters: top: in: query 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 4c06fd0..c74a395 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json @@ -1,4 +1,4 @@ -{ +{ "openapi": "3.0.1", "info": { "title": "OData Service for namespace Microsoft.OData.Service.Sample.TrippinInMemory.Models", @@ -297,6 +297,27 @@ "x-ms-docs-operation-type": "operation" } }, + "/Airlines/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.Airlines", + "responses": { + "200": { + "description": "The count of the resource", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ODataCountResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/error" + } + } + } + }, "/Airports": { "get": { "tags": [ @@ -591,6 +612,27 @@ "x-ms-docs-operation-type": "operation" } }, + "/Airports/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.Airports", + "responses": { + "200": { + "description": "The count of the resource", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ODataCountResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/error" + } + } + } + }, "/GetNearestAirport(lat={lat},lon={lon})": { "get": { "tags": [ @@ -1151,6 +1193,27 @@ "x-ms-docs-operation-type": "operation" } }, + "/Me/Friends/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.Friends", + "responses": { + "200": { + "description": "The count of the resource", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ODataCountResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/error" + } + } + } + }, "/Me/Friends/$ref": { "get": { "tags": [ @@ -2074,6 +2137,42 @@ "x-ms-docs-operation-type": "operation" } }, + "/Me/Trips/{TripId}/PlanItems/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.PlanItems", + "parameters": [ + { + "name": "TripId", + "in": "path", + "description": "key: TripId of Trip", + "required": true, + "schema": { + "maximum": 2147483647, + "minimum": -2147483648, + "type": "integer", + "format": "int32" + }, + "x-ms-docs-key-type": "Trip" + } + ], + "responses": { + "200": { + "description": "The count of the resource", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ODataCountResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/error" + } + } + } + }, "/Me/Trips/{TripId}/PlanItems/$ref": { "get": { "tags": [ @@ -2216,6 +2315,27 @@ "x-ms-docs-operation-type": "operation" } }, + "/Me/Trips/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.Trips", + "responses": { + "200": { + "description": "The count of the resource", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ODataCountResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/error" + } + } + } + }, "/NewComePeople": { "get": { "tags": [ @@ -2961,6 +3081,39 @@ "x-ms-docs-operation-type": "operation" } }, + "/NewComePeople/{UserName}/Friends/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.Friends", + "parameters": [ + { + "name": "UserName", + "in": "path", + "description": "key: UserName of Person", + "required": true, + "schema": { + "type": "string" + }, + "x-ms-docs-key-type": "Person" + } + ], + "responses": { + "200": { + "description": "The count of the resource", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ODataCountResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/error" + } + } + } + }, "/NewComePeople/{UserName}/Friends/$ref": { "get": { "tags": [ @@ -4044,6 +4197,52 @@ "x-ms-docs-operation-type": "operation" } }, + "/NewComePeople/{UserName}/Trips/{TripId}/PlanItems/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.PlanItems", + "parameters": [ + { + "name": "UserName", + "in": "path", + "description": "key: UserName of Person", + "required": true, + "schema": { + "type": "string" + }, + "x-ms-docs-key-type": "Person" + }, + { + "name": "TripId", + "in": "path", + "description": "key: TripId of Trip", + "required": true, + "schema": { + "maximum": 2147483647, + "minimum": -2147483648, + "type": "integer", + "format": "int32" + }, + "x-ms-docs-key-type": "Trip" + } + ], + "responses": { + "200": { + "description": "The count of the resource", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ODataCountResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/error" + } + } + } + }, "/NewComePeople/{UserName}/Trips/{TripId}/PlanItems/$ref": { "get": { "tags": [ @@ -4206,6 +4405,60 @@ "x-ms-docs-operation-type": "operation" } }, + "/NewComePeople/{UserName}/Trips/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.Trips", + "parameters": [ + { + "name": "UserName", + "in": "path", + "description": "key: UserName of Person", + "required": true, + "schema": { + "type": "string" + }, + "x-ms-docs-key-type": "Person" + } + ], + "responses": { + "200": { + "description": "The count of the resource", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ODataCountResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/error" + } + } + } + }, + "/NewComePeople/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.NewComePeople", + "responses": { + "200": { + "description": "The count of the resource", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ODataCountResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/error" + } + } + } + }, "/People": { "get": { "tags": [ @@ -4951,6 +5204,39 @@ "x-ms-docs-operation-type": "operation" } }, + "/People/{UserName}/Friends/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.Friends", + "parameters": [ + { + "name": "UserName", + "in": "path", + "description": "key: UserName of Person", + "required": true, + "schema": { + "type": "string" + }, + "x-ms-docs-key-type": "Person" + } + ], + "responses": { + "200": { + "description": "The count of the resource", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ODataCountResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/error" + } + } + } + }, "/People/{UserName}/Friends/$ref": { "get": { "tags": [ @@ -6034,6 +6320,52 @@ "x-ms-docs-operation-type": "operation" } }, + "/People/{UserName}/Trips/{TripId}/PlanItems/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.PlanItems", + "parameters": [ + { + "name": "UserName", + "in": "path", + "description": "key: UserName of Person", + "required": true, + "schema": { + "type": "string" + }, + "x-ms-docs-key-type": "Person" + }, + { + "name": "TripId", + "in": "path", + "description": "key: TripId of Trip", + "required": true, + "schema": { + "maximum": 2147483647, + "minimum": -2147483648, + "type": "integer", + "format": "int32" + }, + "x-ms-docs-key-type": "Trip" + } + ], + "responses": { + "200": { + "description": "The count of the resource", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ODataCountResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/error" + } + } + } + }, "/People/{UserName}/Trips/{TripId}/PlanItems/$ref": { "get": { "tags": [ @@ -6196,6 +6528,60 @@ "x-ms-docs-operation-type": "operation" } }, + "/People/{UserName}/Trips/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.Trips", + "parameters": [ + { + "name": "UserName", + "in": "path", + "description": "key: UserName of Person", + "required": true, + "schema": { + "type": "string" + }, + "x-ms-docs-key-type": "Person" + } + ], + "responses": { + "200": { + "description": "The count of the resource", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ODataCountResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/error" + } + } + } + }, + "/People/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.People", + "responses": { + "200": { + "description": "The count of the resource", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ODataCountResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/error" + } + } + } + }, "/ResetDataSource": { "post": { "tags": [ @@ -6964,6 +7350,10 @@ "type": "string" } } + }, + "ODataCountResponse": { + "type": "integer", + "format": "int32" } }, "responses": { 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 7b9f87f..1003e1a 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: 3.0.1 info: title: OData Service for namespace Microsoft.OData.Service.Sample.TrippinInMemory.Models description: This OData service is located at http://services.odata.org/TrippinRESTierService @@ -194,6 +194,19 @@ paths: default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation + /Airlines/$count: + get: + summary: Get the number of the resource + operationId: Get.Count.Airlines + responses: + '200': + description: The count of the resource + content: + text/plain: + schema: + $ref: '#/components/schemas/ODataCountResponse' + default: + $ref: '#/components/responses/error' /Airports: get: tags: @@ -390,6 +403,19 @@ paths: default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation + /Airports/$count: + get: + summary: Get the number of the resource + operationId: Get.Count.Airports + responses: + '200': + description: The count of the resource + content: + text/plain: + schema: + $ref: '#/components/schemas/ODataCountResponse' + default: + $ref: '#/components/responses/error' '/GetNearestAirport(lat={lat},lon={lon})': get: tags: @@ -772,6 +798,19 @@ paths: default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation + /Me/Friends/$count: + get: + summary: Get the number of the resource + operationId: Get.Count.Friends + responses: + '200': + description: The count of the resource + content: + text/plain: + schema: + $ref: '#/components/schemas/ODataCountResponse' + default: + $ref: '#/components/responses/error' /Me/Friends/$ref: get: tags: @@ -1396,6 +1435,30 @@ paths: default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation + '/Me/Trips/{TripId}/PlanItems/$count': + get: + summary: Get the number of the resource + operationId: Get.Count.PlanItems + parameters: + - name: TripId + in: path + description: 'key: TripId of Trip' + required: true + schema: + maximum: 2147483647 + minimum: -2147483648 + type: integer + format: int32 + x-ms-docs-key-type: Trip + responses: + '200': + description: The count of the resource + content: + text/plain: + schema: + $ref: '#/components/schemas/ODataCountResponse' + default: + $ref: '#/components/responses/error' '/Me/Trips/{TripId}/PlanItems/$ref': get: tags: @@ -1490,6 +1553,19 @@ paths: default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation + /Me/Trips/$count: + get: + summary: Get the number of the resource + operationId: Get.Count.Trips + responses: + '200': + description: The count of the resource + content: + text/plain: + schema: + $ref: '#/components/schemas/ODataCountResponse' + default: + $ref: '#/components/responses/error' /NewComePeople: get: tags: @@ -2015,6 +2091,27 @@ paths: default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation + '/NewComePeople/{UserName}/Friends/$count': + get: + summary: Get the number of the resource + operationId: Get.Count.Friends + parameters: + - name: UserName + in: path + description: 'key: UserName of Person' + required: true + schema: + type: string + x-ms-docs-key-type: Person + responses: + '200': + description: The count of the resource + content: + text/plain: + schema: + $ref: '#/components/schemas/ODataCountResponse' + default: + $ref: '#/components/responses/error' '/NewComePeople/{UserName}/Friends/$ref': get: tags: @@ -2749,6 +2846,37 @@ paths: default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation + '/NewComePeople/{UserName}/Trips/{TripId}/PlanItems/$count': + get: + summary: Get the number of the resource + operationId: Get.Count.PlanItems + parameters: + - name: UserName + in: path + description: 'key: UserName of Person' + required: true + schema: + type: string + x-ms-docs-key-type: Person + - name: TripId + in: path + description: 'key: TripId of Trip' + required: true + schema: + maximum: 2147483647 + minimum: -2147483648 + type: integer + format: int32 + x-ms-docs-key-type: Trip + responses: + '200': + description: The count of the resource + content: + text/plain: + schema: + $ref: '#/components/schemas/ODataCountResponse' + default: + $ref: '#/components/responses/error' '/NewComePeople/{UserName}/Trips/{TripId}/PlanItems/$ref': get: tags: @@ -2857,6 +2985,40 @@ paths: default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation + '/NewComePeople/{UserName}/Trips/$count': + get: + summary: Get the number of the resource + operationId: Get.Count.Trips + parameters: + - name: UserName + in: path + description: 'key: UserName of Person' + required: true + schema: + type: string + x-ms-docs-key-type: Person + responses: + '200': + description: The count of the resource + content: + text/plain: + schema: + $ref: '#/components/schemas/ODataCountResponse' + default: + $ref: '#/components/responses/error' + /NewComePeople/$count: + get: + summary: Get the number of the resource + operationId: Get.Count.NewComePeople + responses: + '200': + description: The count of the resource + content: + text/plain: + schema: + $ref: '#/components/schemas/ODataCountResponse' + default: + $ref: '#/components/responses/error' /People: get: tags: @@ -3382,6 +3544,27 @@ paths: default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation + '/People/{UserName}/Friends/$count': + get: + summary: Get the number of the resource + operationId: Get.Count.Friends + parameters: + - name: UserName + in: path + description: 'key: UserName of Person' + required: true + schema: + type: string + x-ms-docs-key-type: Person + responses: + '200': + description: The count of the resource + content: + text/plain: + schema: + $ref: '#/components/schemas/ODataCountResponse' + default: + $ref: '#/components/responses/error' '/People/{UserName}/Friends/$ref': get: tags: @@ -4116,6 +4299,37 @@ paths: default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation + '/People/{UserName}/Trips/{TripId}/PlanItems/$count': + get: + summary: Get the number of the resource + operationId: Get.Count.PlanItems + parameters: + - name: UserName + in: path + description: 'key: UserName of Person' + required: true + schema: + type: string + x-ms-docs-key-type: Person + - name: TripId + in: path + description: 'key: TripId of Trip' + required: true + schema: + maximum: 2147483647 + minimum: -2147483648 + type: integer + format: int32 + x-ms-docs-key-type: Trip + responses: + '200': + description: The count of the resource + content: + text/plain: + schema: + $ref: '#/components/schemas/ODataCountResponse' + default: + $ref: '#/components/responses/error' '/People/{UserName}/Trips/{TripId}/PlanItems/$ref': get: tags: @@ -4224,6 +4438,40 @@ paths: default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation + '/People/{UserName}/Trips/$count': + get: + summary: Get the number of the resource + operationId: Get.Count.Trips + parameters: + - name: UserName + in: path + description: 'key: UserName of Person' + required: true + schema: + type: string + x-ms-docs-key-type: Person + responses: + '200': + description: The count of the resource + content: + text/plain: + schema: + $ref: '#/components/schemas/ODataCountResponse' + default: + $ref: '#/components/responses/error' + /People/$count: + get: + summary: Get the number of the resource + operationId: Get.Count.People + responses: + '200': + description: The count of the resource + content: + text/plain: + schema: + $ref: '#/components/schemas/ODataCountResponse' + default: + $ref: '#/components/responses/error' /ResetDataSource: post: tags: @@ -4698,6 +4946,9 @@ components: type: string target: type: string + ODataCountResponse: + type: integer + format: int32 responses: error: description: error