diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.V2.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.V2.json index 6cfcbf9..46db39d 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.V2.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.V2.json @@ -260,6 +260,26 @@ "x-ms-docs-operation-type": "operation" } }, + "/City/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.City", + "produces": [ + "text/plain" + ], + "responses": { + "200": { + "description": "The count of the resource", + "schema": { + "$ref": "#/definitions/ODataCountResponse" + } + }, + "default": { + "$ref": "#/responses/error" + } + } + } + }, "/CountryOrRegion": { "get": { "tags": [ @@ -510,6 +530,26 @@ "x-ms-docs-operation-type": "operation" } }, + "/CountryOrRegion/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.CountryOrRegion", + "produces": [ + "text/plain" + ], + "responses": { + "200": { + "description": "The count of the resource", + "schema": { + "$ref": "#/definitions/ODataCountResponse" + } + }, + "default": { + "$ref": "#/responses/error" + } + } + } + }, "/Me": { "get": { "tags": [ @@ -856,6 +896,26 @@ }, "x-ms-docs-operation-type": "operation" } + }, + "/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" + } + } + } } }, "definitions": { @@ -1029,6 +1089,10 @@ "type": "string" } } + }, + "ODataCountResponse": { + "format": "int32", + "type": "integer" } }, "parameters": { diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.V2.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.V2.yaml index cb4900b..ca55821 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.V2.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.V2.yaml @@ -170,6 +170,19 @@ paths: default: $ref: '#/responses/error' x-ms-docs-operation-type: operation + /City/$count: + get: + summary: Get the number of the resource + operationId: Get.Count.City + produces: + - text/plain + responses: + '200': + description: The count of the resource + schema: + $ref: '#/definitions/ODataCountResponse' + default: + $ref: '#/responses/error' /CountryOrRegion: get: tags: @@ -333,6 +346,19 @@ paths: default: $ref: '#/responses/error' x-ms-docs-operation-type: operation + /CountryOrRegion/$count: + get: + summary: Get the number of the resource + operationId: Get.Count.CountryOrRegion + produces: + - text/plain + responses: + '200': + description: The count of the resource + schema: + $ref: '#/definitions/ODataCountResponse' + default: + $ref: '#/responses/error' /Me: get: tags: @@ -566,6 +592,19 @@ paths: default: $ref: '#/responses/error' x-ms-docs-operation-type: operation + /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' definitions: DefaultNs.Color: title: Color @@ -679,6 +718,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/Basic.OpenApi.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.json index 3a8577f..7c35933 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.json @@ -293,6 +293,27 @@ "x-ms-docs-operation-type": "operation" } }, + "/City/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.City", + "responses": { + "200": { + "description": "The count of the resource", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ODataCountResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/error" + } + } + } + }, "/CountryOrRegion": { "get": { "tags": [ @@ -575,6 +596,27 @@ "x-ms-docs-operation-type": "operation" } }, + "/CountryOrRegion/$count": { + "get": { + "summary": "Get the number of the resource", + "operationId": "Get.Count.CountryOrRegion", + "responses": { + "200": { + "description": "The count of the resource", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ODataCountResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/error" + } + } + } + }, "/Me": { "get": { "tags": [ @@ -961,6 +1003,27 @@ }, "x-ms-docs-operation-type": "operation" } + }, + "/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" + } + } + } } }, "components": { @@ -1135,6 +1198,10 @@ "type": "string" } } + }, + "ODataCountResponse": { + "type": "integer", + "format": "int32" } }, "responses": { diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.yaml index e67d06b..905302e 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.yaml @@ -190,6 +190,19 @@ paths: default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation + /City/$count: + get: + summary: Get the number of the resource + operationId: Get.Count.City + responses: + '200': + description: The count of the resource + content: + text/plain: + schema: + $ref: '#/components/schemas/ODataCountResponse' + default: + $ref: '#/components/responses/error' /CountryOrRegion: get: tags: @@ -374,6 +387,19 @@ paths: default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation + /CountryOrRegion/$count: + get: + summary: Get the number of the resource + operationId: Get.Count.CountryOrRegion + responses: + '200': + description: The count of the resource + content: + text/plain: + schema: + $ref: '#/components/schemas/ODataCountResponse' + default: + $ref: '#/components/responses/error' /Me: get: tags: @@ -634,6 +660,19 @@ paths: default: $ref: '#/components/responses/error' x-ms-docs-operation-type: operation + /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' components: schemas: DefaultNs.Color: @@ -748,6 +787,9 @@ components: type: string target: type: string + ODataCountResponse: + type: integer + format: int32 responses: error: description: error