From d51ddc382291338bb1044354a49c2fa8578ce410 Mon Sep 17 00:00:00 2001 From: Daniel O'Grady Date: Wed, 14 Oct 2026 08:04:54 +0200 Subject: [PATCH 1/3] fix: correct REST collection response shape and count property names CAP REST returns two distinct shapes depending on $count: a bare array without it, or {count, value} with it. OpenAPI cannot condition a response schema on a query parameter value, so document both via oneOf. Also fixes the count property name for REST (count, not @count) and aligns nav-property expansion count with the OData fix (@odata.count). --- CHANGELOG.md | 4 ++ lib/compile/csdl2openapi.js | 48 +++++++++++++++------ lib/compile/types.d.ts | 5 ++- test/lib/compile/csdl2openapi.test.js | 60 +++++++++++++++++++++++++++ 4 files changed, 102 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b7ef0cc..7270479 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/). ### Deprecated ### Removed ### Fixed +- REST collection responses now accurately document both response shapes using `oneOf`: a bare array (returned without `$count`) and an object with `count` + `value` (returned with `$count=true`). Previously the spec always described an object wrapper that didn't match the bare-array response. +- REST collection responses now use `count` (not `@count`) as the count property name, matching the actual CAP REST runtime response. +- Navigation property expansion count is corrected from `nav@count` to `nav@odata.count` for both OData and REST protocols. +- OData collection responses now use `@odata.count` and `@odata.nextLink` instead of the OData 4.01 short forms `@count` and `@nextLink`, matching what CAP actually returns at runtime. ### Security ## [1.7.0] - 2026-10-06 diff --git a/lib/compile/csdl2openapi.js b/lib/compile/csdl2openapi.js index 38d160a..4b2b628 100644 --- a/lib/compile/csdl2openapi.js +++ b/lib/compile/csdl2openapi.js @@ -2069,9 +2069,10 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot description } }; - const countProperty = { [csdl.$Version > '4.0' ? '@count' : '@odata.count']: ref('count') }; + const isRest = !isODataProtocol(protocol); + const countProperty = isRest ? { count: ref('count') } : { [csdl.$Version > '4.0' ? '@count' : '@odata.count']: ref('count') }; const nextLinkKey = csdl.$Version > '4.0' ? '@nextLink' : '@odata.nextLink'; - const nextLinkProperty = { + const nextLinkProperty = isRest ? {} : { [nextLinkKey]: { type: 'string', format: 'uri', @@ -2085,16 +2086,37 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot }; if (type.$Collection) { - // @ts-ignore - not undefined, we set it above - r[code].content['application/json'].schema = { - type: 'object', - title: `Collection of ${nameParts(type.$Type ? type.$Type : 'Edm.String').name}`, - properties: { - ...(isCount && countProperty), - value: s, - ...nextLinkProperty - } - }; + const title = `Collection of ${nameParts(type.$Type ? type.$Type : 'Edm.String').name}`; + if (isRest) { + // CAP REST returns two distinct shapes depending on whether $count=true is passed: + // a bare array without it, or {count, value} with it. OpenAPI cannot condition a + // response schema on a query parameter value, so oneOf is used to document both. + // @ts-ignore - not undefined, we set it above + r[code].content['application/json'].schema = { + title, + oneOf: [ + s, + { + type: 'object', + properties: { + ...(isCount && countProperty), + value: s, + } + } + ] + }; + } else { + // @ts-ignore - not undefined, we set it above + r[code].content['application/json'].schema = { + type: 'object', + title, + properties: { + ...(isCount && countProperty), + value: s, + ...nextLinkProperty + } + }; + } } else if ( @@ -2392,7 +2414,7 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot if (isNavBackReference(property)) return; if (suffix === SUFFIX.read) schemaProperties[iName] = getSchema(property); - if (property.$Collection && suffix === SUFFIX.read && isCount) schemaProperties[`${iName}@${csdl.$Version === '4.0' ? 'odata.' : ''}count`] = ref('count'); + if (property.$Collection && suffix === SUFFIX.read && isCount) schemaProperties[`${iName}@${!isODataProtocol(protocol) || csdl.$Version === '4.0' ? 'odata.' : ''}count`] = ref('count'); if (isNavWritable(property) && suffix === SUFFIX.create) schemaProperties[iName] = getSchema(property, SUFFIX.create); if (isNavWritable(property) && suffix === SUFFIX.update && !property[meta.voc.Core.Immutable]) schemaProperties[iName] = getSchema(property, SUFFIX.create); } diff --git a/lib/compile/types.d.ts b/lib/compile/types.d.ts index 4f70f7e..85638cd 100644 --- a/lib/compile/types.d.ts +++ b/lib/compile/types.d.ts @@ -48,7 +48,8 @@ type SingleSchema = (StringSchema | NumberSchema | BooleanSchema | ArraySchema | type AnyOf = { anyOf: Schema[] } & Meta type AllOf = { allOf: Schema[] } & Meta -type MultiSchema = AnyOf | AllOf +type OneOf = { oneOf: Schema[] } & Meta +type MultiSchema = AnyOf | AllOf | OneOf export type Schema = (SingleSchema | MultiSchema) @@ -100,7 +101,7 @@ type Response = { required?: boolean, description?: string, content?: {[mime in MIMEType]?: { - schema?: SingleSchema & { title?: string }, + schema?: Schema & { title?: string }, example?: string }}, responses?: Record, diff --git a/test/lib/compile/csdl2openapi.test.js b/test/lib/compile/csdl2openapi.test.js index 9c9f1e9..8c514ed 100644 --- a/test/lib/compile/csdl2openapi.test.js +++ b/test/lib/compile/csdl2openapi.test.js @@ -3556,6 +3556,66 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot }); }); +describe("REST protocol", () => { + const csdl = { + $EntityContainer: "this.Container", + this: { + Book: { + $Kind: "EntityType", + $Key: ["ID"], + ID: { $Type: "Edm.Int32" }, + title: { $Nullable: true }, + authors: { $Kind: "NavigationProperty", $Type: "this.Author", $Collection: true }, + }, + Author: { + $Kind: "EntityType", + $Key: ["ID"], + ID: { $Type: "Edm.Int32" }, + }, + Container: { + Books: { $Type: "this.Book", $Collection: true }, + }, + }, + }; + + test("REST collection response uses oneOf: bare array OR object with count+value", () => { + const openapi = lib.csdl2openapi(csdl, { protocol: "rest" }); + const schema = openapi.paths["/Books"].get.responses[200].content["application/json"].schema; + assert.ok(Array.isArray(schema.oneOf), "REST collection response schema must use oneOf"); + assert.strictEqual(schema.oneOf.length, 2, "oneOf must have exactly 2 variants"); + + const [arrayVariant, objectVariant] = schema.oneOf; + assert.strictEqual(arrayVariant.type, "array", "first variant must be bare array"); + + assert.strictEqual(objectVariant.type, "object", "second variant must be object"); + assert.ok("value" in objectVariant.properties, "object variant must have value property"); + assert.ok("count" in objectVariant.properties, "object variant must use 'count' (not '@count') for REST"); + assert.ok(!("@count" in objectVariant.properties), "object variant must not use '@count'"); + assert.ok(!("@odata.count" in objectVariant.properties), "object variant must not use '@odata.count'"); + }); + + test("REST collection response has no @odata.nextLink", () => { + const openapi = lib.csdl2openapi(csdl, { protocol: "rest" }); + const schema = openapi.paths["/Books"].get.responses[200].content["application/json"].schema; + const schemaStr = JSON.stringify(schema); + assert.ok(!schemaStr.includes("nextLink"), "REST collection response must not include nextLink"); + }); + + test("REST nav-property expansion uses @odata.count", () => { + const openapi = lib.csdl2openapi(csdl, { protocol: "rest" }); + const bookSchema = openapi.components.schemas["this.Book"].properties; + assert.ok("authors@odata.count" in bookSchema, "nav-property expansion must use authors@odata.count"); + assert.ok(!("authors@count" in bookSchema), "must not emit bare authors@count"); + }); + + test("OData collection response is unaffected by REST changes", () => { + const openapi = lib.csdl2openapi(csdl, {}); + const schema = openapi.paths["/Books"].get.responses[200].content["application/json"].schema; + assert.ok(!schema.oneOf, "OData collection response must not use oneOf"); + assert.strictEqual(schema.type, "object", "OData collection response must be an object"); + }); +}); + function check(actual, expected) { assert.deepStrictEqual(paths(actual), paths(expected), "Paths"); assert.deepStrictEqual( From f0aa6bbd66215260741d2246aea596397b8a73b3 Mon Sep 17 00:00:00 2001 From: Daniel O'Grady Date: Fri, 16 Oct 2026 14:26:28 +0200 Subject: [PATCH 2/3] Fix odata version --- lib/compile/csdl2openapi.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/compile/csdl2openapi.js b/lib/compile/csdl2openapi.js index 4b2b628..7b2e2ed 100644 --- a/lib/compile/csdl2openapi.js +++ b/lib/compile/csdl2openapi.js @@ -2414,7 +2414,7 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot if (isNavBackReference(property)) return; if (suffix === SUFFIX.read) schemaProperties[iName] = getSchema(property); - if (property.$Collection && suffix === SUFFIX.read && isCount) schemaProperties[`${iName}@${!isODataProtocol(protocol) || csdl.$Version === '4.0' ? 'odata.' : ''}count`] = ref('count'); + if (property.$Collection && suffix === SUFFIX.read && isCount) schemaProperties[`${iName}@odata.count`] = ref('count'); if (isNavWritable(property) && suffix === SUFFIX.create) schemaProperties[iName] = getSchema(property, SUFFIX.create); if (isNavWritable(property) && suffix === SUFFIX.update && !property[meta.voc.Core.Immutable]) schemaProperties[iName] = getSchema(property, SUFFIX.create); } From f94c7503a861921350aa2a3171f04eb1c8a269f7 Mon Sep 17 00:00:00 2001 From: Daniel O'Grady Date: Fri, 16 Oct 2026 15:26:56 +0200 Subject: [PATCH 3/3] Fix tests --- .../Northwind-key-as-segment.openapi3.json | 26 +++++++++---------- test/lib/compile/data/People.openapi3.json | 2 +- test/lib/compile/data/Products.openapi3.json | 6 ++--- test/lib/compile/data/TripPin.openapi3.json | 8 +++--- .../compile/data/aggregation.openapi3.json | 6 ++--- .../compile/data/annotations.openapi3.json | 6 ++--- .../autoexposed-composition.openapi3.json | 2 +- .../data/autoexposed-texts.openapi3.json | 2 +- .../compile/data/back-reference.openapi3.json | 2 +- .../compile/data/containment.openapi3.json | 10 +++---- test/lib/compile/data/csdl-16.1.openapi3.json | 4 +-- .../compile/data/descriptions.openapi3.json | 4 +-- test/lib/compile/data/example.openapi3.json | 8 +++--- .../compile/data/miscellaneous.openapi3.json | 2 +- .../compile/data/non-expandable.openapi3.json | 2 +- 15 files changed, 45 insertions(+), 45 deletions(-) diff --git a/test/lib/compile/data/Northwind-key-as-segment.openapi3.json b/test/lib/compile/data/Northwind-key-as-segment.openapi3.json index 775dcf7..e901641 100644 --- a/test/lib/compile/data/Northwind-key-as-segment.openapi3.json +++ b/test/lib/compile/data/Northwind-key-as-segment.openapi3.json @@ -10534,7 +10534,7 @@ "$ref": "#/components/schemas/NorthwindModel.Product" } }, - "Products@count": { + "Products@odata.count": { "$ref": "#/components/schemas/count" } } @@ -10760,7 +10760,7 @@ "$ref": "#/components/schemas/NorthwindModel.Order" } }, - "Orders@count": { + "Orders@odata.count": { "$ref": "#/components/schemas/count" }, "CustomerDemographics": { @@ -10769,7 +10769,7 @@ "$ref": "#/components/schemas/NorthwindModel.CustomerDemographic" } }, - "CustomerDemographics@count": { + "CustomerDemographics@odata.count": { "$ref": "#/components/schemas/count" } } @@ -10909,7 +10909,7 @@ "$ref": "#/components/schemas/NorthwindModel.Customer" } }, - "Customers@count": { + "Customers@odata.count": { "$ref": "#/components/schemas/count" } } @@ -11107,7 +11107,7 @@ "$ref": "#/components/schemas/NorthwindModel.Employee" } }, - "Employees1@count": { + "Employees1@odata.count": { "$ref": "#/components/schemas/count" }, "Employee1": { @@ -11124,7 +11124,7 @@ "$ref": "#/components/schemas/NorthwindModel.Order" } }, - "Orders@count": { + "Orders@odata.count": { "$ref": "#/components/schemas/count" }, "Territories": { @@ -11133,7 +11133,7 @@ "$ref": "#/components/schemas/NorthwindModel.Territory" } }, - "Territories@count": { + "Territories@odata.count": { "$ref": "#/components/schemas/count" } } @@ -11903,7 +11903,7 @@ "$ref": "#/components/schemas/NorthwindModel.Order_Detail" } }, - "Order_Details@count": { + "Order_Details@odata.count": { "$ref": "#/components/schemas/count" }, "Shipper": { @@ -12892,7 +12892,7 @@ "$ref": "#/components/schemas/NorthwindModel.Order_Detail" } }, - "Order_Details@count": { + "Order_Details@odata.count": { "$ref": "#/components/schemas/count" }, "Supplier": { @@ -13286,7 +13286,7 @@ "$ref": "#/components/schemas/NorthwindModel.Territory" } }, - "Territories@count": { + "Territories@odata.count": { "$ref": "#/components/schemas/count" } } @@ -13540,7 +13540,7 @@ "$ref": "#/components/schemas/NorthwindModel.Order" } }, - "Orders@count": { + "Orders@odata.count": { "$ref": "#/components/schemas/count" } } @@ -13839,7 +13839,7 @@ "$ref": "#/components/schemas/NorthwindModel.Product" } }, - "Products@count": { + "Products@odata.count": { "$ref": "#/components/schemas/count" } } @@ -13994,7 +13994,7 @@ "$ref": "#/components/schemas/NorthwindModel.Employee" } }, - "Employees@count": { + "Employees@odata.count": { "$ref": "#/components/schemas/count" } } diff --git a/test/lib/compile/data/People.openapi3.json b/test/lib/compile/data/People.openapi3.json index 8c31b37..f3ee6b4 100644 --- a/test/lib/compile/data/People.openapi3.json +++ b/test/lib/compile/data/People.openapi3.json @@ -1688,7 +1688,7 @@ "$ref": "./Products.openapi3.json#/components/schemas/ProductService.Product" } }, - "Products@count": { + "Products@odata.count": { "$ref": "#/components/schemas/count" } } diff --git a/test/lib/compile/data/Products.openapi3.json b/test/lib/compile/data/Products.openapi3.json index 4dc62ad..dd606c5 100644 --- a/test/lib/compile/data/Products.openapi3.json +++ b/test/lib/compile/data/Products.openapi3.json @@ -1944,7 +1944,7 @@ "$ref": "#/components/schemas/ProductService.Product" } }, - "Products@count": { + "Products@odata.count": { "$ref": "#/components/schemas/count" } } @@ -2025,7 +2025,7 @@ "$ref": "#/components/schemas/ProductService.Category" } }, - "Categories@count": { + "Categories@odata.count": { "$ref": "#/components/schemas/count" }, "Supplier": { @@ -2192,7 +2192,7 @@ "$ref": "#/components/schemas/ProductService.Category" } }, - "Categories@count": { + "Categories@odata.count": { "$ref": "#/components/schemas/count" }, "Supplier": { diff --git a/test/lib/compile/data/TripPin.openapi3.json b/test/lib/compile/data/TripPin.openapi3.json index 51e4cba..587cf1f 100644 --- a/test/lib/compile/data/TripPin.openapi3.json +++ b/test/lib/compile/data/TripPin.openapi3.json @@ -3949,7 +3949,7 @@ "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Person" } }, - "Friends@count": { + "Friends@odata.count": { "$ref": "#/components/schemas/count" }, "Trips": { @@ -3958,7 +3958,7 @@ "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Trip" } }, - "Trips@count": { + "Trips@odata.count": { "$ref": "#/components/schemas/count" }, "Photo": { @@ -4386,7 +4386,7 @@ "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Photo" } }, - "Photos@count": { + "Photos@odata.count": { "$ref": "#/components/schemas/count" }, "PlanItems": { @@ -4395,7 +4395,7 @@ "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.PlanItem" } }, - "PlanItems@count": { + "PlanItems@odata.count": { "$ref": "#/components/schemas/count" } } diff --git a/test/lib/compile/data/aggregation.openapi3.json b/test/lib/compile/data/aggregation.openapi3.json index 74e50b3..026ef0f 100644 --- a/test/lib/compile/data/aggregation.openapi3.json +++ b/test/lib/compile/data/aggregation.openapi3.json @@ -883,7 +883,7 @@ "$ref": "#/components/schemas/org.example.odata.salesservice.Product" } }, - "Products@count": { + "Products@odata.count": { "$ref": "#/components/schemas/count" }, "Name": { @@ -943,7 +943,7 @@ "$ref": "#/components/schemas/org.example.odata.salesservice.Sales" } }, - "Sales@count": { + "Sales@odata.count": { "$ref": "#/components/schemas/count" }, "Name": { @@ -975,7 +975,7 @@ "$ref": "#/components/schemas/org.example.odata.salesservice.Sales" } }, - "Sales@count": { + "Sales@odata.count": { "$ref": "#/components/schemas/count" }, "Name": { diff --git a/test/lib/compile/data/annotations.openapi3.json b/test/lib/compile/data/annotations.openapi3.json index b3748ef..e93bf64 100644 --- a/test/lib/compile/data/annotations.openapi3.json +++ b/test/lib/compile/data/annotations.openapi3.json @@ -2506,7 +2506,7 @@ "$ref": "#/components/schemas/Supported.Annotations.TwoPartKey" } }, - "AllMany@count": { + "AllMany@odata.count": { "$ref": "#/components/schemas/count" }, "ReadOnlyOne": { @@ -2523,7 +2523,7 @@ "$ref": "#/components/schemas/Supported.Annotations.TwoPartKey" } }, - "ReadOnlyMany@count": { + "ReadOnlyMany@odata.count": { "$ref": "#/components/schemas/count" }, "NothingOne": { @@ -2540,7 +2540,7 @@ "$ref": "#/components/schemas/Supported.Annotations.TwoPartKey" } }, - "NothingMany@count": { + "NothingMany@odata.count": { "$ref": "#/components/schemas/count" } } diff --git a/test/lib/compile/data/autoexposed-composition.openapi3.json b/test/lib/compile/data/autoexposed-composition.openapi3.json index 2c7115a..44fe463 100644 --- a/test/lib/compile/data/autoexposed-composition.openapi3.json +++ b/test/lib/compile/data/autoexposed-composition.openapi3.json @@ -618,7 +618,7 @@ "$ref": "#/components/schemas/MyService.OrderItems" } }, - "items@count": { + "items@odata.count": { "$ref": "#/components/schemas/count" } } diff --git a/test/lib/compile/data/autoexposed-texts.openapi3.json b/test/lib/compile/data/autoexposed-texts.openapi3.json index 00378d7..21e25c6 100644 --- a/test/lib/compile/data/autoexposed-texts.openapi3.json +++ b/test/lib/compile/data/autoexposed-texts.openapi3.json @@ -584,7 +584,7 @@ "$ref": "#/components/schemas/AdminService.Books_texts" } }, - "texts@count": { + "texts@odata.count": { "$ref": "#/components/schemas/count" } } diff --git a/test/lib/compile/data/back-reference.openapi3.json b/test/lib/compile/data/back-reference.openapi3.json index c4ff107..1171601 100644 --- a/test/lib/compile/data/back-reference.openapi3.json +++ b/test/lib/compile/data/back-reference.openapi3.json @@ -760,7 +760,7 @@ "$ref": "#/components/schemas/UsageService.UsageRecordCustomReferences" } }, - "customReferences@count": { + "customReferences@odata.count": { "$ref": "#/components/schemas/count" } } diff --git a/test/lib/compile/data/containment.openapi3.json b/test/lib/compile/data/containment.openapi3.json index 0a6160a..5df20cd 100644 --- a/test/lib/compile/data/containment.openapi3.json +++ b/test/lib/compile/data/containment.openapi3.json @@ -5123,7 +5123,7 @@ "$ref": "#/components/schemas/Containment.Folder" } }, - "Folders@count": { + "Folders@odata.count": { "$ref": "#/components/schemas/count" } } @@ -5188,7 +5188,7 @@ "$ref": "#/components/schemas/Containment.SubPart" } }, - "Many@count": { + "Many@odata.count": { "$ref": "#/components/schemas/count" }, "ManyReadListOnly": { @@ -5197,7 +5197,7 @@ "$ref": "#/components/schemas/Containment.SubPart" } }, - "ManyReadListOnly@count": { + "ManyReadListOnly@odata.count": { "$ref": "#/components/schemas/count" }, "ManyReadByKeyOnly": { @@ -5206,7 +5206,7 @@ "$ref": "#/components/schemas/Containment.SubPart" } }, - "ManyReadByKeyOnly@count": { + "ManyReadByKeyOnly@odata.count": { "$ref": "#/components/schemas/count" } } @@ -5343,7 +5343,7 @@ "$ref": "#/components/schemas/Containment.Part" } }, - "Many@count": { + "Many@odata.count": { "$ref": "#/components/schemas/count" } } diff --git a/test/lib/compile/data/csdl-16.1.openapi3.json b/test/lib/compile/data/csdl-16.1.openapi3.json index 5f1fc9e..a083e13 100644 --- a/test/lib/compile/data/csdl-16.1.openapi3.json +++ b/test/lib/compile/data/csdl-16.1.openapi3.json @@ -2167,7 +2167,7 @@ "$ref": "#/components/schemas/ODataDemo.Product" } }, - "Products@count": { + "Products@odata.count": { "$ref": "#/components/schemas/count" } } @@ -2435,7 +2435,7 @@ "$ref": "#/components/schemas/ODataDemo.Product" } }, - "Products@count": { + "Products@odata.count": { "$ref": "#/components/schemas/count" } } diff --git a/test/lib/compile/data/descriptions.openapi3.json b/test/lib/compile/data/descriptions.openapi3.json index 1a39357..9adaa3b 100644 --- a/test/lib/compile/data/descriptions.openapi3.json +++ b/test/lib/compile/data/descriptions.openapi3.json @@ -3495,7 +3495,7 @@ "$ref": "#/components/schemas/descriptions.subEntity" } }, - "contained@count": { + "contained@odata.count": { "$ref": "#/components/schemas/count" }, "related": { @@ -3504,7 +3504,7 @@ "$ref": "#/components/schemas/descriptions.entity" } }, - "related@count": { + "related@odata.count": { "$ref": "#/components/schemas/count" } }, diff --git a/test/lib/compile/data/example.openapi3.json b/test/lib/compile/data/example.openapi3.json index 0b8ee59..6e6acb0 100644 --- a/test/lib/compile/data/example.openapi3.json +++ b/test/lib/compile/data/example.openapi3.json @@ -3313,7 +3313,7 @@ "$ref": "#/components/schemas/ODataDemo.Product" } }, - "Products@count": { + "Products@odata.count": { "$ref": "#/components/schemas/count" } } @@ -3621,7 +3621,7 @@ "$ref": "#/components/schemas/ODataDemo.Category" } }, - "Categories@count": { + "Categories@odata.count": { "$ref": "#/components/schemas/count" }, "Supplier": { @@ -3970,7 +3970,7 @@ "$ref": "#/components/schemas/ODataDemo.Category" } }, - "Categories@count": { + "Categories@odata.count": { "$ref": "#/components/schemas/count" }, "Supplier": { @@ -4185,7 +4185,7 @@ "$ref": "#/components/schemas/ODataDemo.Product" } }, - "Products@count": { + "Products@odata.count": { "$ref": "#/components/schemas/count" } } diff --git a/test/lib/compile/data/miscellaneous.openapi3.json b/test/lib/compile/data/miscellaneous.openapi3.json index e7ef678..5cefde4 100644 --- a/test/lib/compile/data/miscellaneous.openapi3.json +++ b/test/lib/compile/data/miscellaneous.openapi3.json @@ -2805,7 +2805,7 @@ "$ref": "#/components/schemas/org.example.Product" } }, - "Products@count": { + "Products@odata.count": { "$ref": "#/components/schemas/count" } } diff --git a/test/lib/compile/data/non-expandable.openapi3.json b/test/lib/compile/data/non-expandable.openapi3.json index 8865ca6..938f3c4 100644 --- a/test/lib/compile/data/non-expandable.openapi3.json +++ b/test/lib/compile/data/non-expandable.openapi3.json @@ -1067,7 +1067,7 @@ "$ref": "#/components/schemas/CatalogService.Pages" } }, - "pages@count": { + "pages@odata.count": { "$ref": "#/components/schemas/count" } }