From 4649249cb7353372368839b8bd755cabf80de08a Mon Sep 17 00:00:00 2001 From: Tim Schulze-Hartung Date: Fri, 25 Sep 2026 14:55:53 +0200 Subject: [PATCH 1/2] fix: emit @odata.nextLink in collection response schema --- CHANGELOG.md | 1 + lib/compile/csdl2openapi.js | 11 +- scripts/regenerate.js | 6 +- test/lib/compile/csdl2openapi.test.js | 66 + .../Northwind-key-as-segment.openapi3.json | 195 ++ test/lib/compile/data/People.openapi3.json | 20 + test/lib/compile/data/Products.openapi3.json | 30 + test/lib/compile/data/TripPin.openapi3.json | 80 + .../compile/data/aggregation.openapi3.json | 10 + .../compile/data/annotations.openapi3.json | 70 + .../compile/data/authorization.openapi3.json | 5 + .../data/autoexposed-codelist.openapi3.json | 10 + .../autoexposed-composition.openapi3.json | 10 + .../data/autoexposed-direct.openapi3.json | 10 + .../data/autoexposed-texts.openapi3.json | 10 + .../compile/data/back-reference.openapi3.json | 1756 +++++++++-------- .../compile/data/containment.openapi3.json | 75 + test/lib/compile/data/csdl-16.1.openapi3.json | 40 + .../data/custom-parameters.openapi3.json | 5 + .../data/description-fallback.openapi3.json | 5 + .../compile/data/descriptions.openapi3.json | 50 + test/lib/compile/data/example.openapi3.json | 50 + .../data/immutable-composition.openapi3.json | 5 + .../compile/data/miscellaneous.openapi3.json | 65 + .../compile/data/non-expandable.openapi3.json | 15 + ...meter-with-both-descriptions.openapi3.json | 5 + 26 files changed, 1730 insertions(+), 875 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 02fe0f3..6a40a6f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/). ### Added - Added `defaultProtocol` configuration option as fallback if no config is provided. +- Collection responses now include the optional `@odata.nextLink` / `@nextLink` property in their schema, documenting server-driven paging as per the OData specification. ### Changed - set `odata` as the service protocol if no protocol is set to match the default behavior of `@sap/cds`. Provide `cds.env.openapi.defaultProtocol = "rest"` to restore old behavior. - ER diagrams are now rendered using the yuml.me v1 API (`app.yuml.me`), avoiding the 'please migrate' image. The diagram and legend are displayed as clickable SVG images. diff --git a/lib/compile/csdl2openapi.js b/lib/compile/csdl2openapi.js index e65eb8d..14615e9 100644 --- a/lib/compile/csdl2openapi.js +++ b/lib/compile/csdl2openapi.js @@ -1909,6 +1909,14 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot } }; const CountPropertyObj = { [csdl.$Version > '4.0' ? '@count' : '@odata.count']: ref('count') }; + const nextLinkKey = csdl.$Version > '4.0' ? '@nextLink' : '@odata.nextLink'; + const NextLinkPropertyObj = { + [nextLinkKey]: { + type: 'string', + format: 'uri', + description: 'URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)' + } + }; if (code != 204) { const s = getSchema(type); r[code].content = { @@ -1922,7 +1930,8 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot title: `Collection of ${nameParts(type.$Type ? type.$Type : 'Edm.String').name}`, properties: { ...(isCount && CountPropertyObj), - value: s + value: s, + ...NextLinkPropertyObj } }; } diff --git a/scripts/regenerate.js b/scripts/regenerate.js index 9cc4418..644b4e9 100644 --- a/scripts/regenerate.js +++ b/scripts/regenerate.js @@ -14,7 +14,11 @@ const specialOptions = { basePath: '/V4/(S(cnbm44wtbc1v5bgrlek5lpcc))/TripPinServiceRW', diagram: true }, - 'autoexposed-texts': {} + 'autoexposed-texts': {}, + 'autoexposed-direct': {}, + 'autoexposed-composition': {}, + 'autoexposed-codelist': {}, + 'back-reference': { diagram: false }, }; // Default options for all other test cases. diff --git a/test/lib/compile/csdl2openapi.test.js b/test/lib/compile/csdl2openapi.test.js index cbfdd54..9c9f1e9 100644 --- a/test/lib/compile/csdl2openapi.test.js +++ b/test/lib/compile/csdl2openapi.test.js @@ -1185,6 +1185,11 @@ describe("Edge cases", () => { maxLength: 20, }, }, + "@odata.nextLink": { + type: "string", + format: "uri", + description: "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)", + }, }, }, }, @@ -1260,6 +1265,11 @@ describe("Edge cases", () => { //TODO:delta }, }, + "@nextLink": { + type: "string", + format: "uri", + description: "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)", + }, "@odata.deltaLink": { example: "/service-root/Set?$deltatoken=opaque server-generated token for fetching the delta", @@ -1281,6 +1291,32 @@ describe("Edge cases", () => { ); }); + test("nextLink in collection response", () => { + const csdl = { + $EntityContainer: "this.Container", + this: { + ET: { $Kind: "EntityType", $Key: ["key"], key: {} }, + Container: { Set: { $Type: "this.ET", $Collection: true } }, + }, + }; + const v401 = lib.csdl2openapi(csdl, {}); + const v401Props = v401.paths["/Set"].get.responses[200].content["application/json"].schema.properties; + assert.ok("@nextLink" in v401Props, "v4.01 should have @nextLink"); + assert.deepStrictEqual(v401Props["@nextLink"], { + type: "string", + format: "uri", + description: "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)", + }); + assert.ok(!("@odata.nextLink" in v401Props), "v4.01 must not emit @odata.nextLink"); + assert.ok(!("@nextLink" in (v401.paths["/Set('{key}')"].get.responses[200].content["application/json"].schema.properties ?? {})), + "by-key response must not have @nextLink"); + + const v40 = lib.csdl2openapi(csdl, { odataVersion: "4.0" }); + const v40Props = v40.paths["/Set"].get.responses[200].content["application/json"].schema.properties; + assert.ok("@odata.nextLink" in v40Props, "v4.0 should have @odata.nextLink"); + assert.ok(!("@nextLink" in v40Props), "v4.0 must not emit @nextLink"); + }); + test("entity set and singleton with non-existing type", () => { const csdl = { $EntityContainer: "this.Container", @@ -1328,6 +1364,11 @@ describe("Edge cases", () => { $ref: "#/components/schemas/undefined.type_does_not_exist", }, }, + "@nextLink": { + type: "string", + format: "uri", + description: "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)", + }, }, }, }, @@ -1565,6 +1606,11 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot $ref: "#/components/schemas/this.derived", }, }, + "@nextLink": { + type: "string", + format: "uri", + description: "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)", + }, }, }, }, @@ -1756,6 +1802,11 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot $ref: "#/components/schemas/this.source", }, }, + "@nextLink": { + type: "string", + format: "uri", + description: "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)", + }, }, }, }, @@ -1923,6 +1974,11 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot $ref: "#/components/schemas/this.Category", }, }, + "@nextLink": { + type: "string", + format: "uri", + description: "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)", + }, }, }, }, @@ -2128,6 +2184,11 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot $ref: "#/components/schemas/this.thing", }, }, + "@nextLink": { + type: "string", + format: "uri", + description: "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)", + }, }, }, }, @@ -3451,6 +3512,11 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot $ref: "#/components/schemas/this.thing", }, }, + "@nextLink": { + type: "string", + format: "uri", + description: "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)", + }, }, }, }, 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 6949dae..775dcf7 100644 --- a/test/lib/compile/data/Northwind-key-as-segment.openapi3.json +++ b/test/lib/compile/data/Northwind-key-as-segment.openapi3.json @@ -239,6 +239,11 @@ "items": { "$ref": "#/components/schemas/NorthwindModel.Alphabetical_list_of_product" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -518,6 +523,11 @@ "items": { "$ref": "#/components/schemas/NorthwindModel.Category" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -811,6 +821,11 @@ "items": { "$ref": "#/components/schemas/NorthwindModel.Product" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -937,6 +952,11 @@ "items": { "$ref": "#/components/schemas/NorthwindModel.Category_Sales_for_1997" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -1155,6 +1175,11 @@ "items": { "$ref": "#/components/schemas/NorthwindModel.Current_Product_List" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -1400,6 +1425,11 @@ "items": { "$ref": "#/components/schemas/NorthwindModel.CustomerDemographic" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -1693,6 +1723,11 @@ "items": { "$ref": "#/components/schemas/NorthwindModel.Customer" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -1825,6 +1860,11 @@ "items": { "$ref": "#/components/schemas/NorthwindModel.Customer_and_Suppliers_by_City" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -2100,6 +2140,11 @@ "items": { "$ref": "#/components/schemas/NorthwindModel.Customer" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -2375,6 +2420,11 @@ "items": { "$ref": "#/components/schemas/NorthwindModel.CustomerDemographic" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -2570,6 +2620,11 @@ "items": { "$ref": "#/components/schemas/NorthwindModel.Order" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -2764,6 +2819,11 @@ "items": { "$ref": "#/components/schemas/NorthwindModel.Employee" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -3188,6 +3248,11 @@ "items": { "$ref": "#/components/schemas/NorthwindModel.Employee" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -3382,6 +3447,11 @@ "items": { "$ref": "#/components/schemas/NorthwindModel.Order" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -3542,6 +3612,11 @@ "items": { "$ref": "#/components/schemas/NorthwindModel.Territory" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -3740,6 +3815,11 @@ "items": { "$ref": "#/components/schemas/NorthwindModel.Invoice" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -4108,6 +4188,11 @@ "items": { "$ref": "#/components/schemas/NorthwindModel.Order_Detail" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -4561,6 +4646,11 @@ "items": { "$ref": "#/components/schemas/NorthwindModel.Order_Details_Extended" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -4853,6 +4943,11 @@ "items": { "$ref": "#/components/schemas/NorthwindModel.Order_Subtotal" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -5127,6 +5222,11 @@ "items": { "$ref": "#/components/schemas/NorthwindModel.Order" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -5590,6 +5690,11 @@ "items": { "$ref": "#/components/schemas/NorthwindModel.Order_Detail" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -5843,6 +5948,11 @@ "items": { "$ref": "#/components/schemas/NorthwindModel.Orders_Qry" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -6092,6 +6202,11 @@ "items": { "$ref": "#/components/schemas/NorthwindModel.Product_Sales_for_1997" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -6364,6 +6479,11 @@ "items": { "$ref": "#/components/schemas/NorthwindModel.Product" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -6723,6 +6843,11 @@ "items": { "$ref": "#/components/schemas/NorthwindModel.Order_Detail" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -6931,6 +7056,11 @@ "items": { "$ref": "#/components/schemas/NorthwindModel.Products_Above_Average_Price" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -7158,6 +7288,11 @@ "items": { "$ref": "#/components/schemas/NorthwindModel.Products_by_Category" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -7415,6 +7550,11 @@ "items": { "$ref": "#/components/schemas/NorthwindModel.Region" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -7684,6 +7824,11 @@ "items": { "$ref": "#/components/schemas/NorthwindModel.Territory" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -7816,6 +7961,11 @@ "items": { "$ref": "#/components/schemas/NorthwindModel.Sales_Totals_by_Amount" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -8052,6 +8202,11 @@ "items": { "$ref": "#/components/schemas/NorthwindModel.Sales_by_Category" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -8312,6 +8467,11 @@ "items": { "$ref": "#/components/schemas/NorthwindModel.Shipper" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -8617,6 +8777,11 @@ "items": { "$ref": "#/components/schemas/NorthwindModel.Order" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -8746,6 +8911,11 @@ "items": { "$ref": "#/components/schemas/NorthwindModel.Summary_of_Sales_by_Quarter" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -8968,6 +9138,11 @@ "items": { "$ref": "#/components/schemas/NorthwindModel.Summary_of_Sales_by_Year" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -9234,6 +9409,11 @@ "items": { "$ref": "#/components/schemas/NorthwindModel.Supplier" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -9535,6 +9715,11 @@ "items": { "$ref": "#/components/schemas/NorthwindModel.Product" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -9682,6 +9867,11 @@ "items": { "$ref": "#/components/schemas/NorthwindModel.Territory" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -10000,6 +10190,11 @@ "items": { "$ref": "#/components/schemas/NorthwindModel.Employee" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } diff --git a/test/lib/compile/data/People.openapi3.json b/test/lib/compile/data/People.openapi3.json index adbfb48..8c31b37 100644 --- a/test/lib/compile/data/People.openapi3.json +++ b/test/lib/compile/data/People.openapi3.json @@ -160,6 +160,11 @@ "items": { "$ref": "#/components/schemas/PeopleService.Person" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -508,6 +513,11 @@ "items": { "$ref": "#/components/schemas/PeopleService.PersonDetail" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -914,6 +924,11 @@ "items": { "$ref": "#/components/schemas/PeopleService.Supplier" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -1128,6 +1143,11 @@ "items": { "$ref": "./Products.openapi3.json#/components/schemas/ProductService.Product" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } diff --git a/test/lib/compile/data/Products.openapi3.json b/test/lib/compile/data/Products.openapi3.json index 52b8026..4dc62ad 100644 --- a/test/lib/compile/data/Products.openapi3.json +++ b/test/lib/compile/data/Products.openapi3.json @@ -166,6 +166,11 @@ "items": { "$ref": "#/components/schemas/ProductService.Advertisement" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -564,6 +569,11 @@ "items": { "$ref": "#/components/schemas/ProductService.Category" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -846,6 +856,11 @@ "items": { "$ref": "#/components/schemas/ProductService.Product" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -989,6 +1004,11 @@ "items": { "$ref": "#/components/schemas/ProductService.ProductDetail" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -1337,6 +1357,11 @@ "items": { "$ref": "#/components/schemas/ProductService.Product" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -1609,6 +1634,11 @@ "items": { "$ref": "#/components/schemas/ProductService.Category" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } diff --git a/test/lib/compile/data/TripPin.openapi3.json b/test/lib/compile/data/TripPin.openapi3.json index beacf93..51e4cba 100644 --- a/test/lib/compile/data/TripPin.openapi3.json +++ b/test/lib/compile/data/TripPin.openapi3.json @@ -149,6 +149,11 @@ "items": { "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Airline" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -380,6 +385,11 @@ "items": { "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Airport" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -744,6 +754,11 @@ "items": { "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Person" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -848,6 +863,11 @@ "items": { "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Trip" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -1055,6 +1075,11 @@ "items": { "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Trip" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -1251,6 +1276,11 @@ "items": { "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Person" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -1356,6 +1386,11 @@ "items": { "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Photo" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -1470,6 +1505,11 @@ "items": { "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.PlanItem" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -1741,6 +1781,11 @@ "items": { "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Person" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -2033,6 +2078,11 @@ "items": { "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Person" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -2155,6 +2205,11 @@ "items": { "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Trip" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -2395,6 +2450,11 @@ "items": { "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Trip" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -2609,6 +2669,11 @@ "items": { "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Person" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -2723,6 +2788,11 @@ "items": { "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Photo" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -2846,6 +2916,11 @@ "items": { "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.PlanItem" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -3086,6 +3161,11 @@ "items": { "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Photo" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } diff --git a/test/lib/compile/data/aggregation.openapi3.json b/test/lib/compile/data/aggregation.openapi3.json index 3905fb3..74e50b3 100644 --- a/test/lib/compile/data/aggregation.openapi3.json +++ b/test/lib/compile/data/aggregation.openapi3.json @@ -140,6 +140,11 @@ "items": { "$ref": "#/components/schemas/org.example.odata.salesservice.Currency" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -378,6 +383,11 @@ "items": { "$ref": "#/components/schemas/org.example.odata.salesservice.Sales" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } diff --git a/test/lib/compile/data/annotations.openapi3.json b/test/lib/compile/data/annotations.openapi3.json index b22e980..b3748ef 100644 --- a/test/lib/compile/data/annotations.openapi3.json +++ b/test/lib/compile/data/annotations.openapi3.json @@ -206,6 +206,11 @@ "items": { "$ref": "#/components/schemas/Supported.Annotations.SinglePartKey" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -400,6 +405,11 @@ "items": { "$ref": "#/components/schemas/Supported.Annotations.TwoPartKey" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -499,6 +509,11 @@ "items": { "$ref": "#/components/schemas/Supported.Annotations.TwoPartKey" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -707,6 +722,11 @@ "items": { "$ref": "#/components/schemas/Supported.Annotations.TwoPartKey" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -784,6 +804,11 @@ "items": { "$ref": "#/components/schemas/Supported.Annotations.TwoPartKey" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -972,6 +997,11 @@ "items": { "$ref": "#/components/schemas/Supported.Annotations.SinglePartKey" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -1226,6 +1256,11 @@ "items": { "$ref": "#/components/schemas/Supported.Annotations.SinglePartKey" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -1421,6 +1456,11 @@ "items": { "$ref": "#/components/schemas/Supported.Annotations.TwoPartKey" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -1454,6 +1494,11 @@ "items": { "$ref": "#/components/schemas/Supported.Annotations.SinglePartKey" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -1572,6 +1617,11 @@ "items": { "$ref": "#/components/schemas/Supported.Annotations.TwoPartKey" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -1709,6 +1759,11 @@ "items": { "$ref": "#/components/schemas/Supported.Annotations.TwoPartKey" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -1743,6 +1798,11 @@ "items": { "$ref": "#/components/schemas/Supported.Annotations.TwoPartKey" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -1859,6 +1919,11 @@ "items": { "$ref": "#/components/schemas/Supported.Annotations.TwoPartKey" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -2091,6 +2156,11 @@ "items": { "$ref": "#/components/schemas/Supported.Annotations.TwoPartKey" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } diff --git a/test/lib/compile/data/authorization.openapi3.json b/test/lib/compile/data/authorization.openapi3.json index 6b6434e..7b18809 100644 --- a/test/lib/compile/data/authorization.openapi3.json +++ b/test/lib/compile/data/authorization.openapi3.json @@ -137,6 +137,11 @@ "items": { "$ref": "#/components/schemas/auth.example.Person" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } diff --git a/test/lib/compile/data/autoexposed-codelist.openapi3.json b/test/lib/compile/data/autoexposed-codelist.openapi3.json index ce2ed8f..7d3e73a 100644 --- a/test/lib/compile/data/autoexposed-codelist.openapi3.json +++ b/test/lib/compile/data/autoexposed-codelist.openapi3.json @@ -140,6 +140,11 @@ "items": { "$ref": "#/components/schemas/MyService.Currencies" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -301,6 +306,11 @@ "items": { "$ref": "#/components/schemas/MyService.Orders" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } diff --git a/test/lib/compile/data/autoexposed-composition.openapi3.json b/test/lib/compile/data/autoexposed-composition.openapi3.json index 9074e0a..2c7115a 100644 --- a/test/lib/compile/data/autoexposed-composition.openapi3.json +++ b/test/lib/compile/data/autoexposed-composition.openapi3.json @@ -151,6 +151,11 @@ "items": { "$ref": "#/components/schemas/MyService.Orders" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -398,6 +403,11 @@ "items": { "$ref": "#/components/schemas/MyService.OrderItems" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } diff --git a/test/lib/compile/data/autoexposed-direct.openapi3.json b/test/lib/compile/data/autoexposed-direct.openapi3.json index d1cb590..1a49363 100644 --- a/test/lib/compile/data/autoexposed-direct.openapi3.json +++ b/test/lib/compile/data/autoexposed-direct.openapi3.json @@ -154,6 +154,11 @@ "items": { "$ref": "#/components/schemas/MyService.Orders" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -443,6 +448,11 @@ "items": { "$ref": "#/components/schemas/MyService.ScanStates" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } diff --git a/test/lib/compile/data/autoexposed-texts.openapi3.json b/test/lib/compile/data/autoexposed-texts.openapi3.json index 2e0e9c3..00378d7 100644 --- a/test/lib/compile/data/autoexposed-texts.openapi3.json +++ b/test/lib/compile/data/autoexposed-texts.openapi3.json @@ -151,6 +151,11 @@ "items": { "$ref": "#/components/schemas/AdminService.Books" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -398,6 +403,11 @@ "items": { "$ref": "#/components/schemas/AdminService.Books_texts" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } diff --git a/test/lib/compile/data/back-reference.openapi3.json b/test/lib/compile/data/back-reference.openapi3.json index 66d7602..c4ff107 100644 --- a/test/lib/compile/data/back-reference.openapi3.json +++ b/test/lib/compile/data/back-reference.openapi3.json @@ -1,911 +1,921 @@ { - "openapi": "3.0.2", - "info": { - "title": "Use the title annotation on your CDS service to provide a meaningful title.", - "description": "Usage Record Service", - "version": "" - }, - "x-sap-api-type": "ODATAV4", - "x-odata-version": "4.01", - "x-sap-shortText": "Usage Record Service", - "servers": [ - { - "url": "https://localhost/service-root" - } - ], - "tags": [ - { - "name": "Usage Records" - } - ], - "paths": { - "/$batch": { - "post": { - "summary": "Sends a group of requests", - "description": "Group multiple requests into a single request payload, see [Batch Requests](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_BatchRequests).\n\n*Please note that \"Try it out\" is not supported for this request.*", - "tags": [ - "Batch Requests" - ], - "requestBody": { - "required": true, - "description": "Batch request", - "content": { - "multipart/mixed;boundary=request-separator": { - "schema": { - "type": "string" - }, - "example": "--request-separator\nContent-Type: application/http\nContent-Transfer-Encoding: binary\n\nGET UsageRecords HTTP/1.1\nAccept: application/json\n\n\n--request-separator--" - } - } - }, - "responses": { - "200": { - "description": "Batch response", - "content": { - "multipart/mixed": { - "schema": { - "type": "string" - }, - "example": "--response-separator\nContent-Type: application/http\n\nHTTP/1.1 200 OK\nContent-Type: application/json\n\n{...}\n--response-separator--" - } - } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } + "openapi": "3.0.2", + "info": { + "title": "Use the title annotation on your CDS service to provide a meaningful title.", + "description": "Usage Record Service", + "version": "" + }, + "x-sap-api-type": "ODATAV4", + "x-odata-version": "4.01", + "x-sap-shortText": "Usage Record Service", + "servers": [ + { + "url": "https://localhost/service-root" + } + ], + "tags": [ + { + "name": "Usage Records" + } + ], + "paths": { + "/$batch": { + "post": { + "summary": "Sends a group of requests", + "description": "Group multiple requests into a single request payload, see [Batch Requests](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_BatchRequests).\n\n*Please note that \"Try it out\" is not supported for this request.*", + "tags": [ + "Batch Requests" + ], + "requestBody": { + "required": true, + "description": "Batch request", + "content": { + "multipart/mixed;boundary=request-separator": { + "schema": { + "type": "string" + }, + "example": "--request-separator\nContent-Type: application/http\nContent-Transfer-Encoding: binary\n\nGET UsageRecords HTTP/1.1\nAccept: application/json\n\n\n--request-separator--" } + } }, - "/UsageRecords": { - "get": { - "summary": "Retrieves a list of usage records.", - "tags": [ - "Usage Records" - ], - "parameters": [ - { - "$ref": "#/components/parameters/top" - }, - { - "$ref": "#/components/parameters/skip" - }, - { - "$ref": "#/components/parameters/search" - }, - { - "name": "$filter", - "description": "Filter items by property values, see [Filtering](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionfilter)", - "in": "query", - "schema": { - "type": "string" - } - }, - { - "$ref": "#/components/parameters/count" - }, - { - "name": "$orderby", - "description": "Order items by property values, see [Sorting](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionorderby)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "ID", - "ID desc", - "description", - "description desc" - ] - } - } - }, - { - "name": "$select", - "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "ID", - "description" - ] - } - } - }, - { - "name": "$expand", - "description": "The value of $expand query option is a comma-separated list of navigation property names, stream property names, or $value indicating the stream content of a media-entity. The corresponding related entities and stream values will be represented inline, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "*", - "customReferences" - ] - } - } - } - ], - "responses": { - "200": { - "description": "Retrieved usage records", - "content": { - "application/json": { - "schema": { - "type": "object", - "title": "Collection of UsageRecords", - "properties": { - "@count": { - "$ref": "#/components/schemas/count" - }, - "value": { - "type": "array", - "items": { - "$ref": "#/components/schemas/UsageService.UsageRecords" - } - } - } - } - } - } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - }, - "post": { - "summary": "Creates a single usage record.", - "tags": [ - "Usage Records" - ], - "requestBody": { - "description": "New usage record", - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UsageService.UsageRecords-create" - } - } - } + "responses": { + "200": { + "description": "Batch response", + "content": { + "multipart/mixed": { + "schema": { + "type": "string" }, - "responses": { - "201": { - "description": "Created usage record", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UsageService.UsageRecords" - } - } - } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } + "example": "--response-separator\nContent-Type: application/http\n\nHTTP/1.1 200 OK\nContent-Type: application/json\n\n{...}\n--response-separator--" + } } - }, - "/UsageRecords({ID})": { - "parameters": [ - { - "description": "key: ID", - "in": "path", - "name": "ID", - "required": true, - "schema": { - "type": "string", - "format": "uuid", - "example": "01234567-89ab-cdef-0123-456789abcdef" - } - } - ], - "get": { - "summary": "Retrieves a single usage record.", - "tags": [ - "Usage Records" - ], - "parameters": [ - { - "name": "$select", - "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "ID", - "description" - ] - } - } - }, - { - "name": "$expand", - "description": "The value of $expand query option is a comma-separated list of navigation property names, stream property names, or $value indicating the stream content of a media-entity. The corresponding related entities and stream values will be represented inline, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "*", - "customReferences" - ] - } - } - } - ], - "responses": { - "200": { - "description": "Retrieved usage record", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UsageService.UsageRecords" - } - } - } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - }, - "patch": { - "summary": "Changes a single usage record.", - "tags": [ - "Usage Records" - ], - "requestBody": { - "description": "New property values", - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UsageService.UsageRecords-update" - } - } - } - }, - "responses": { - "204": { - "description": "Success" - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - }, - "delete": { - "summary": "Deletes a single usage record.", - "tags": [ - "Usage Records" - ], - "responses": { - "204": { - "description": "Success" - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + } + }, + "/UsageRecords": { + "get": { + "summary": "Retrieves a list of usage records.", + "tags": [ + "Usage Records" + ], + "parameters": [ + { + "$ref": "#/components/parameters/top" + }, + { + "$ref": "#/components/parameters/skip" + }, + { + "$ref": "#/components/parameters/search" + }, + { + "name": "$filter", + "description": "Filter items by property values, see [Filtering](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionfilter)", + "in": "query", + "schema": { + "type": "string" } - }, - "/UsageRecords({ID})/customReferences": { - "parameters": [ - { - "description": "key: ID", - "in": "path", - "name": "ID", - "required": true, - "schema": { - "type": "string", - "format": "uuid", - "example": "01234567-89ab-cdef-0123-456789abcdef" - } - } - ], - "get": { - "summary": "Retrieves a list of custom references of a usage record.", - "tags": [ - "Usage Records" - ], - "parameters": [ - { - "$ref": "#/components/parameters/top" - }, - { - "$ref": "#/components/parameters/skip" - }, - { - "$ref": "#/components/parameters/search" - }, - { - "name": "$filter", - "description": "Filter items by property values, see [Filtering](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionfilter)", - "in": "query", - "schema": { - "type": "string" - } - }, - { - "$ref": "#/components/parameters/count" - }, - { - "name": "$orderby", - "description": "Order items by property values, see [Sorting](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionorderby)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "ID", - "ID desc", - "type", - "type desc", - "value", - "value desc" - ] - } - } - }, - { - "name": "$select", - "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "ID", - "type", - "value" - ] - } - } - }, - { - "name": "$expand", - "description": "The value of $expand query option is a comma-separated list of navigation property names, stream property names, or $value indicating the stream content of a media-entity. The corresponding related entities and stream values will be represented inline, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "*", - "usageRecord" - ] - } - } - } - ], - "responses": { - "200": { - "description": "Retrieved custom references", - "content": { - "application/json": { - "schema": { - "type": "object", - "title": "Collection of UsageRecordCustomReferences", - "properties": { - "@count": { - "$ref": "#/components/schemas/count" - }, - "value": { - "type": "array", - "items": { - "$ref": "#/components/schemas/UsageService.UsageRecordCustomReferences" - } - } - } - } - } - } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - }, - "post": { - "summary": "Creates a single custom reference of a usage record.", - "tags": [ - "Usage Records" - ], - "requestBody": { - "description": "New custom reference", - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UsageService.UsageRecordCustomReferences-create" - } - } - } - }, - "responses": { - "201": { - "description": "Created custom reference", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UsageService.UsageRecordCustomReferences" - } - } - } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } + }, + { + "$ref": "#/components/parameters/count" + }, + { + "name": "$orderby", + "description": "Order items by property values, see [Sorting](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionorderby)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "ID desc", + "description", + "description desc" + ] + } } - }, - "/UsageRecords({ID})/customReferences({ID_1})": { - "parameters": [ - { - "description": "key: ID", - "in": "path", - "name": "ID", - "required": true, - "schema": { - "type": "string", - "format": "uuid", - "example": "01234567-89ab-cdef-0123-456789abcdef" - } - }, - { - "description": "key: ID", - "in": "path", - "name": "ID_1", - "required": true, - "schema": { - "type": "string", - "format": "uuid", - "example": "01234567-89ab-cdef-0123-456789abcdef" - } - } - ], - "get": { - "summary": "Retrieves a single custom reference of a usage record.", - "tags": [ - "Usage Records" - ], - "parameters": [ - { - "name": "$select", - "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "ID", - "type", - "value" - ] - } - } - }, - { - "name": "$expand", - "description": "The value of $expand query option is a comma-separated list of navigation property names, stream property names, or $value indicating the stream content of a media-entity. The corresponding related entities and stream values will be represented inline, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "*", - "usageRecord" - ] - } - } - } - ], - "responses": { - "200": { - "description": "Retrieved custom reference", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UsageService.UsageRecordCustomReferences" - } - } - } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - }, - "patch": { - "summary": "Changes a single custom reference of a usage record.", - "tags": [ - "Usage Records" - ], - "requestBody": { - "description": "New property values", - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UsageService.UsageRecordCustomReferences-update" - } - } - } - }, - "responses": { - "204": { - "description": "Success" + }, + { + "name": "$select", + "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "description" + ] + } + } + }, + { + "name": "$expand", + "description": "The value of $expand query option is a comma-separated list of navigation property names, stream property names, or $value indicating the stream content of a media-entity. The corresponding related entities and stream values will be represented inline, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "customReferences" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved usage records", + "content": { + "application/json": { + "schema": { + "type": "object", + "title": "Collection of UsageRecords", + "properties": { + "@count": { + "$ref": "#/components/schemas/count" }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - }, - "delete": { - "summary": "Deletes a single custom reference of a usage record.", - "tags": [ - "Usage Records" - ], - "responses": { - "204": { - "description": "Success" + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UsageService.UsageRecords" + } }, - "4XX": { - "$ref": "#/components/responses/error" + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } + } } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "post": { + "summary": "Creates a single usage record.", + "tags": [ + "Usage Records" + ], + "requestBody": { + "description": "New usage record", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UsageService.UsageRecords-create" + } } + } }, - "/UsageRecords({ID})/customReferences({ID_1})/usageRecord": { - "parameters": [ - { - "description": "key: ID", - "in": "path", - "name": "ID", - "required": true, - "schema": { - "type": "string", - "format": "uuid", - "example": "01234567-89ab-cdef-0123-456789abcdef" - } - }, - { - "description": "key: ID", - "in": "path", - "name": "ID_1", - "required": true, - "schema": { - "type": "string", - "format": "uuid", - "example": "01234567-89ab-cdef-0123-456789abcdef" - } - } - ], - "get": { - "summary": "Retrieves usage record of a usage record.", - "tags": [ - "Usage Records" - ], - "parameters": [ - { - "name": "$select", - "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "ID", - "description" - ] - } - } - }, - { - "name": "$expand", - "description": "The value of $expand query option is a comma-separated list of navigation property names, stream property names, or $value indicating the stream content of a media-entity. The corresponding related entities and stream values will be represented inline, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "*", - "customReferences" - ] - } - } - } - ], - "responses": { - "200": { - "description": "Retrieved usage record", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UsageService.UsageRecords" - } - } - } - }, - "4XX": { - "$ref": "#/components/responses/error" - } + "responses": { + "201": { + "description": "Created usage record", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UsageService.UsageRecords" } + } } + }, + "4XX": { + "$ref": "#/components/responses/error" + } } + } }, - "components": { - "schemas": { - "UsageService.UsageRecordCustomReferences": { - "title": "UsageRecordCustomReferences", - "type": "object", - "properties": { - "ID": { - "type": "string", - "format": "uuid", - "example": "01234567-89ab-cdef-0123-456789abcdef" - }, - "type": { - "type": "string", - "nullable": true - }, - "value": { - "type": "string", - "nullable": true - } - } - }, - "UsageService.UsageRecordCustomReferences-create": { - "title": "UsageRecordCustomReferences (for create)", - "type": "object", - "properties": { - "ID": { - "type": "string", - "format": "uuid", - "example": "01234567-89ab-cdef-0123-456789abcdef" - }, - "type": { - "type": "string", - "nullable": true - }, - "value": { - "type": "string", - "nullable": true - } - }, - "required": [ - "ID" + "/UsageRecords({ID})": { + "parameters": [ + { + "description": "key: ID", + "in": "path", + "name": "ID", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "example": "01234567-89ab-cdef-0123-456789abcdef" + } + } + ], + "get": { + "summary": "Retrieves a single usage record.", + "tags": [ + "Usage Records" + ], + "parameters": [ + { + "name": "$select", + "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "description" ] - }, - "UsageService.UsageRecordCustomReferences-update": { - "title": "UsageRecordCustomReferences (for update)", - "type": "object", - "properties": { - "type": { - "type": "string", - "nullable": true - }, - "value": { - "type": "string", - "nullable": true - } - } - }, - "UsageService.UsageRecords": { - "title": "UsageRecords", - "type": "object", - "properties": { - "ID": { - "type": "string", - "format": "uuid", - "example": "01234567-89ab-cdef-0123-456789abcdef" - }, - "description": { - "type": "string", - "nullable": true - }, - "customReferences": { - "type": "array", - "items": { - "$ref": "#/components/schemas/UsageService.UsageRecordCustomReferences" - } - }, - "customReferences@count": { - "$ref": "#/components/schemas/count" - } + } + } + }, + { + "name": "$expand", + "description": "The value of $expand query option is a comma-separated list of navigation property names, stream property names, or $value indicating the stream content of a media-entity. The corresponding related entities and stream values will be represented inline, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "customReferences" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved usage record", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UsageService.UsageRecords" } - }, - "UsageService.UsageRecords-create": { - "title": "UsageRecords (for create)", - "type": "object", - "properties": { - "ID": { - "type": "string", - "format": "uuid", - "example": "01234567-89ab-cdef-0123-456789abcdef" - }, - "description": { - "type": "string", - "nullable": true - }, - "customReferences": { - "type": "array", - "items": { - "$ref": "#/components/schemas/UsageService.UsageRecordCustomReferences-create" - } - } - }, - "required": [ - "ID" + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "patch": { + "summary": "Changes a single usage record.", + "tags": [ + "Usage Records" + ], + "requestBody": { + "description": "New property values", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UsageService.UsageRecords-update" + } + } + } + }, + "responses": { + "204": { + "description": "Success" + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "delete": { + "summary": "Deletes a single usage record.", + "tags": [ + "Usage Records" + ], + "responses": { + "204": { + "description": "Success" + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + } + }, + "/UsageRecords({ID})/customReferences": { + "parameters": [ + { + "description": "key: ID", + "in": "path", + "name": "ID", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "example": "01234567-89ab-cdef-0123-456789abcdef" + } + } + ], + "get": { + "summary": "Retrieves a list of custom references of a usage record.", + "tags": [ + "Usage Records" + ], + "parameters": [ + { + "$ref": "#/components/parameters/top" + }, + { + "$ref": "#/components/parameters/skip" + }, + { + "$ref": "#/components/parameters/search" + }, + { + "name": "$filter", + "description": "Filter items by property values, see [Filtering](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionfilter)", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/count" + }, + { + "name": "$orderby", + "description": "Order items by property values, see [Sorting](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionorderby)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "ID desc", + "type", + "type desc", + "value", + "value desc" ] - }, - "UsageService.UsageRecords-update": { - "title": "UsageRecords (for update)", - "type": "object", - "properties": { - "description": { - "type": "string", - "nullable": true + } + } + }, + { + "name": "$select", + "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "type", + "value" + ] + } + } + }, + { + "name": "$expand", + "description": "The value of $expand query option is a comma-separated list of navigation property names, stream property names, or $value indicating the stream content of a media-entity. The corresponding related entities and stream values will be represented inline, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "usageRecord" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved custom references", + "content": { + "application/json": { + "schema": { + "type": "object", + "title": "Collection of UsageRecordCustomReferences", + "properties": { + "@count": { + "$ref": "#/components/schemas/count" }, - "customReferences": { - "type": "array", - "items": { - "$ref": "#/components/schemas/UsageService.UsageRecordCustomReferences-create" - } - } - } - }, - "count": { - "anyOf": [ - { - "type": "number" + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UsageService.UsageRecordCustomReferences" + } }, - { - "type": "string" - } - ], - "description": "The number of entities in the collection. Available when using the [$count](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptioncount) query option." - }, - "error": { - "type": "object", - "required": [ - "error" - ], - "properties": { - "error": { - "type": "object", - "required": [ - "code", - "message" - ], - "properties": { - "code": { - "type": "string" - }, - "message": { - "type": "string" - }, - "target": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "required": [ - "code", - "message" - ], - "properties": { - "code": { - "type": "string" - }, - "message": { - "type": "string" - }, - "target": { - "type": "string" - } - } - } - }, - "innererror": { - "type": "object", - "description": "The structure of this object is service-specific" - } - } + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } + } } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "post": { + "summary": "Creates a single custom reference of a usage record.", + "tags": [ + "Usage Records" + ], + "requestBody": { + "description": "New custom reference", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UsageService.UsageRecordCustomReferences-create" + } } + } }, - "parameters": { - "top": { - "name": "$top", - "in": "query", - "description": "Show only the first n items, see [Paging - Top](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptiontop)", - "schema": { - "type": "integer", - "minimum": 0 - }, - "example": 50 - }, - "skip": { - "name": "$skip", - "in": "query", - "description": "Skip the first n items, see [Paging - Skip](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionskip)", + "responses": { + "201": { + "description": "Created custom reference", + "content": { + "application/json": { "schema": { - "type": "integer", - "minimum": 0 + "$ref": "#/components/schemas/UsageService.UsageRecordCustomReferences" } - }, - "count": { - "name": "$count", - "in": "query", - "description": "Include count of items, see [Count](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptioncount)", + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + } + }, + "/UsageRecords({ID})/customReferences({ID_1})": { + "parameters": [ + { + "description": "key: ID", + "in": "path", + "name": "ID", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "example": "01234567-89ab-cdef-0123-456789abcdef" + } + }, + { + "description": "key: ID", + "in": "path", + "name": "ID_1", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "example": "01234567-89ab-cdef-0123-456789abcdef" + } + } + ], + "get": { + "summary": "Retrieves a single custom reference of a usage record.", + "tags": [ + "Usage Records" + ], + "parameters": [ + { + "name": "$select", + "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "type", + "value" + ] + } + } + }, + { + "name": "$expand", + "description": "The value of $expand query option is a comma-separated list of navigation property names, stream property names, or $value indicating the stream content of a media-entity. The corresponding related entities and stream values will be represented inline, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "usageRecord" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved custom reference", + "content": { + "application/json": { "schema": { - "type": "boolean" + "$ref": "#/components/schemas/UsageService.UsageRecordCustomReferences" } - }, - "search": { - "name": "$search", - "in": "query", - "description": "Search items by search phrases, see [Searching](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionsearch)", + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "patch": { + "summary": "Changes a single custom reference of a usage record.", + "tags": [ + "Usage Records" + ], + "requestBody": { + "description": "New property values", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UsageService.UsageRecordCustomReferences-update" + } + } + } + }, + "responses": { + "204": { + "description": "Success" + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "delete": { + "summary": "Deletes a single custom reference of a usage record.", + "tags": [ + "Usage Records" + ], + "responses": { + "204": { + "description": "Success" + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + } + }, + "/UsageRecords({ID})/customReferences({ID_1})/usageRecord": { + "parameters": [ + { + "description": "key: ID", + "in": "path", + "name": "ID", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "example": "01234567-89ab-cdef-0123-456789abcdef" + } + }, + { + "description": "key: ID", + "in": "path", + "name": "ID_1", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "example": "01234567-89ab-cdef-0123-456789abcdef" + } + } + ], + "get": { + "summary": "Retrieves usage record of a usage record.", + "tags": [ + "Usage Records" + ], + "parameters": [ + { + "name": "$select", + "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "description" + ] + } + } + }, + { + "name": "$expand", + "description": "The value of $expand query option is a comma-separated list of navigation property names, stream property names, or $value indicating the stream content of a media-entity. The corresponding related entities and stream values will be represented inline, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "customReferences" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved usage record", + "content": { + "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/UsageService.UsageRecords" } + } } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + } + } + }, + "components": { + "schemas": { + "UsageService.UsageRecordCustomReferences": { + "title": "UsageRecordCustomReferences", + "type": "object", + "properties": { + "ID": { + "type": "string", + "format": "uuid", + "example": "01234567-89ab-cdef-0123-456789abcdef" + }, + "type": { + "type": "string", + "nullable": true + }, + "value": { + "type": "string", + "nullable": true + } + } + }, + "UsageService.UsageRecordCustomReferences-create": { + "title": "UsageRecordCustomReferences (for create)", + "type": "object", + "properties": { + "ID": { + "type": "string", + "format": "uuid", + "example": "01234567-89ab-cdef-0123-456789abcdef" + }, + "type": { + "type": "string", + "nullable": true + }, + "value": { + "type": "string", + "nullable": true + } }, - "responses": { - "error": { - "description": "Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } + "required": [ + "ID" + ] + }, + "UsageService.UsageRecordCustomReferences-update": { + "title": "UsageRecordCustomReferences (for update)", + "type": "object", + "properties": { + "type": { + "type": "string", + "nullable": true + }, + "value": { + "type": "string", + "nullable": true + } + } + }, + "UsageService.UsageRecords": { + "title": "UsageRecords", + "type": "object", + "properties": { + "ID": { + "type": "string", + "format": "uuid", + "example": "01234567-89ab-cdef-0123-456789abcdef" + }, + "description": { + "type": "string", + "nullable": true + }, + "customReferences": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UsageService.UsageRecordCustomReferences" + } + }, + "customReferences@count": { + "$ref": "#/components/schemas/count" + } + } + }, + "UsageService.UsageRecords-create": { + "title": "UsageRecords (for create)", + "type": "object", + "properties": { + "ID": { + "type": "string", + "format": "uuid", + "example": "01234567-89ab-cdef-0123-456789abcdef" + }, + "description": { + "type": "string", + "nullable": true + }, + "customReferences": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UsageService.UsageRecordCustomReferences-create" + } + } + }, + "required": [ + "ID" + ] + }, + "UsageService.UsageRecords-update": { + "title": "UsageRecords (for update)", + "type": "object", + "properties": { + "description": { + "type": "string", + "nullable": true + }, + "customReferences": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UsageService.UsageRecordCustomReferences-create" + } + } + } + }, + "count": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "The number of entities in the collection. Available when using the [$count](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptioncount) query option." + }, + "error": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "target": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "target": { + "type": "string" + } + } } + }, + "innererror": { + "type": "object", + "description": "The structure of this object is service-specific" + } + } + } + } + } + }, + "parameters": { + "top": { + "name": "$top", + "in": "query", + "description": "Show only the first n items, see [Paging - Top](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptiontop)", + "schema": { + "type": "integer", + "minimum": 0 + }, + "example": 50 + }, + "skip": { + "name": "$skip", + "in": "query", + "description": "Skip the first n items, see [Paging - Skip](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionskip)", + "schema": { + "type": "integer", + "minimum": 0 + } + }, + "count": { + "name": "$count", + "in": "query", + "description": "Include count of items, see [Count](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptioncount)", + "schema": { + "type": "boolean" + } + }, + "search": { + "name": "$search", + "in": "query", + "description": "Search items by search phrases, see [Searching](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionsearch)", + "schema": { + "type": "string" + } + } + }, + "responses": { + "error": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error" } + } } + } } -} \ No newline at end of file + } +} diff --git a/test/lib/compile/data/containment.openapi3.json b/test/lib/compile/data/containment.openapi3.json index 9be0370..0a6160a 100644 --- a/test/lib/compile/data/containment.openapi3.json +++ b/test/lib/compile/data/containment.openapi3.json @@ -126,6 +126,11 @@ "items": { "$ref": "#/components/schemas/Containment.Folder" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -388,6 +393,11 @@ "items": { "$ref": "#/components/schemas/Containment.Folder" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -668,6 +678,11 @@ "items": { "$ref": "#/components/schemas/Containment.Folder" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -966,6 +981,11 @@ "items": { "$ref": "#/components/schemas/Containment.Folder" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -1282,6 +1302,11 @@ "items": { "$ref": "#/components/schemas/Containment.Folder" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -1616,6 +1641,11 @@ "items": { "$ref": "#/components/schemas/Containment.Folder" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -1843,6 +1873,11 @@ "items": { "$ref": "#/components/schemas/Containment.Part" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -2092,6 +2127,11 @@ "items": { "$ref": "#/components/schemas/Containment.SubPart" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -2346,6 +2386,11 @@ "items": { "$ref": "#/components/schemas/Containment.SubPart" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -2770,6 +2815,11 @@ "items": { "$ref": "#/components/schemas/Containment.SubPart" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -3211,6 +3261,11 @@ "items": { "$ref": "#/components/schemas/Containment.Whole" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -3474,6 +3529,11 @@ "items": { "$ref": "#/components/schemas/Containment.Part" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -3741,6 +3801,11 @@ "items": { "$ref": "#/components/schemas/Containment.SubPart" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -4074,6 +4139,11 @@ "items": { "$ref": "#/components/schemas/Containment.SubPart" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -4567,6 +4637,11 @@ "items": { "$ref": "#/components/schemas/Containment.SubPart" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } diff --git a/test/lib/compile/data/csdl-16.1.openapi3.json b/test/lib/compile/data/csdl-16.1.openapi3.json index 80d3f1f..5f1fc9e 100644 --- a/test/lib/compile/data/csdl-16.1.openapi3.json +++ b/test/lib/compile/data/csdl-16.1.openapi3.json @@ -168,6 +168,11 @@ "items": { "$ref": "#/components/schemas/ODataDemo.Category" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -449,6 +454,11 @@ "items": { "$ref": "#/components/schemas/ODataDemo.Product" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -575,6 +585,11 @@ "items": { "$ref": "#/components/schemas/ODataDemo.Country" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -956,6 +971,11 @@ "items": { "$ref": "#/components/schemas/ODataDemo.Product" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -1115,6 +1135,11 @@ "items": { "$ref": "#/components/schemas/ODataDemo.Product" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -1515,6 +1540,11 @@ "items": { "$ref": "#/components/schemas/ODataDemo.Product" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -1640,6 +1670,11 @@ "items": { "$ref": "#/components/schemas/ODataDemo.Supplier" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -1976,6 +2011,11 @@ "items": { "$ref": "#/components/schemas/ODataDemo.Product" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } diff --git a/test/lib/compile/data/custom-parameters.openapi3.json b/test/lib/compile/data/custom-parameters.openapi3.json index efebe4b..25d3894 100644 --- a/test/lib/compile/data/custom-parameters.openapi3.json +++ b/test/lib/compile/data/custom-parameters.openapi3.json @@ -228,6 +228,11 @@ "items": { "$ref": "#/components/schemas/custom.parameters.ent" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } diff --git a/test/lib/compile/data/description-fallback.openapi3.json b/test/lib/compile/data/description-fallback.openapi3.json index 257f14f..d47aa7a 100644 --- a/test/lib/compile/data/description-fallback.openapi3.json +++ b/test/lib/compile/data/description-fallback.openapi3.json @@ -137,6 +137,11 @@ "items": { "$ref": "#/components/schemas/test.Book" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } diff --git a/test/lib/compile/data/descriptions.openapi3.json b/test/lib/compile/data/descriptions.openapi3.json index 05cae56..1a39357 100644 --- a/test/lib/compile/data/descriptions.openapi3.json +++ b/test/lib/compile/data/descriptions.openapi3.json @@ -330,6 +330,11 @@ "items": { "$ref": "#/components/schemas/descriptions.entity" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -626,6 +631,11 @@ "items": { "$ref": "#/components/schemas/descriptions.subEntity" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -987,6 +997,11 @@ "items": { "$ref": "#/components/schemas/descriptions.entity" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -1261,6 +1276,11 @@ "items": { "$ref": "#/components/schemas/descriptions.entity" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -1512,6 +1532,11 @@ "items": { "$ref": "#/components/schemas/descriptions.subEntity" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -1838,6 +1863,11 @@ "items": { "$ref": "#/components/schemas/descriptions.entity" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -2372,6 +2402,11 @@ "items": { "$ref": "#/components/schemas/descriptions.subEntity" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -2663,6 +2698,11 @@ "items": { "$ref": "#/components/schemas/descriptions.entity" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -2981,6 +3021,11 @@ "items": { "$ref": "#/components/schemas/descriptions.subEntity" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -3272,6 +3317,11 @@ "items": { "$ref": "#/components/schemas/descriptions.entity" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } diff --git a/test/lib/compile/data/example.openapi3.json b/test/lib/compile/data/example.openapi3.json index b29eed5..0b8ee59 100644 --- a/test/lib/compile/data/example.openapi3.json +++ b/test/lib/compile/data/example.openapi3.json @@ -175,6 +175,11 @@ "items": { "$ref": "#/components/schemas/ODataDemo.Advertisement" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -573,6 +578,11 @@ "items": { "$ref": "#/components/schemas/ODataDemo.Category" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -855,6 +865,11 @@ "items": { "$ref": "#/components/schemas/ODataDemo.Product" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -1058,6 +1073,11 @@ "items": { "$ref": "#/components/schemas/ODataDemo.PersonDetail" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -1448,6 +1468,11 @@ "items": { "$ref": "#/components/schemas/ODataDemo.Person" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -1776,6 +1801,11 @@ "items": { "$ref": "#/components/schemas/ODataDemo.ProductDetail" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -2124,6 +2154,11 @@ "items": { "$ref": "#/components/schemas/ODataDemo.Product" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -2396,6 +2431,11 @@ "items": { "$ref": "#/components/schemas/ODataDemo.Category" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -2768,6 +2808,11 @@ "items": { "$ref": "#/components/schemas/ODataDemo.Supplier" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -3053,6 +3098,11 @@ "items": { "$ref": "#/components/schemas/ODataDemo.Product" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } diff --git a/test/lib/compile/data/immutable-composition.openapi3.json b/test/lib/compile/data/immutable-composition.openapi3.json index 20891d4..60711ce 100644 --- a/test/lib/compile/data/immutable-composition.openapi3.json +++ b/test/lib/compile/data/immutable-composition.openapi3.json @@ -152,6 +152,11 @@ "items": { "$ref": "#/components/schemas/test.Parent" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } diff --git a/test/lib/compile/data/miscellaneous.openapi3.json b/test/lib/compile/data/miscellaneous.openapi3.json index 3aaf6dd..e7ef678 100644 --- a/test/lib/compile/data/miscellaneous.openapi3.json +++ b/test/lib/compile/data/miscellaneous.openapi3.json @@ -175,6 +175,11 @@ "items": { "$ref": "#/components/schemas/org.example.Category" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -438,6 +443,11 @@ "items": { "$ref": "#/components/schemas/org.example.Product" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -578,6 +588,11 @@ "items": { "$ref": "#/components/schemas/org.example.Category" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -840,6 +855,11 @@ "items": { "$ref": "#/components/schemas/org.example.Product" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -947,6 +967,11 @@ "items": { "$ref": "#/components/schemas/org.example.Category" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -1209,6 +1234,11 @@ "items": { "$ref": "#/components/schemas/org.example.Product" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -1391,6 +1421,11 @@ "items": { "$ref": "#/components/schemas/org.example.Order" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -1613,6 +1648,11 @@ "items": { "$ref": "#/components/schemas/org.example.Customer" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -1847,6 +1887,11 @@ "items": { "$ref": "#/components/schemas/org.example.Product" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -2223,6 +2268,11 @@ "items": { "$ref": "#/components/schemas/org.example.Product" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -2313,6 +2363,11 @@ "items": { "$ref": "#/components/schemas/org.example.Customer" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -2526,6 +2581,11 @@ "items": { "$ref": "#/components/schemas/org.example.Supplier" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -2711,6 +2771,11 @@ "items": { "$ref": "#/components/schemas/org.example.Product" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } diff --git a/test/lib/compile/data/non-expandable.openapi3.json b/test/lib/compile/data/non-expandable.openapi3.json index 1a20a3e..8865ca6 100644 --- a/test/lib/compile/data/non-expandable.openapi3.json +++ b/test/lib/compile/data/non-expandable.openapi3.json @@ -154,6 +154,11 @@ "items": { "$ref": "#/components/schemas/CatalogService.Books" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -421,6 +426,11 @@ "items": { "$ref": "#/components/schemas/CatalogService.Pages" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } @@ -789,6 +799,11 @@ "items": { "$ref": "#/components/schemas/CatalogService.Pages" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } diff --git a/test/lib/compile/data/parameter-with-both-descriptions.openapi3.json b/test/lib/compile/data/parameter-with-both-descriptions.openapi3.json index 48fcfe9..367dddf 100644 --- a/test/lib/compile/data/parameter-with-both-descriptions.openapi3.json +++ b/test/lib/compile/data/parameter-with-both-descriptions.openapi3.json @@ -137,6 +137,11 @@ "items": { "$ref": "#/components/schemas/test.Item" } + }, + "@nextLink": { + "type": "string", + "format": "uri", + "description": "URL of the next page in server-driven paging, see [Server-driven Paging](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_ServerDrivenPaging)" } } } From 30d103965e2ed890b8a2cc5e0d89f33b2587b6d7 Mon Sep 17 00:00:00 2001 From: Tim Schulze-Hartung Date: Mon, 28 Sep 2026 15:04:08 +0200 Subject: [PATCH 2/2] refactor: use lowerCamelCase for local property variables --- lib/compile/csdl2openapi.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/compile/csdl2openapi.js b/lib/compile/csdl2openapi.js index 14615e9..acc2f20 100644 --- a/lib/compile/csdl2openapi.js +++ b/lib/compile/csdl2openapi.js @@ -1908,9 +1908,9 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot description } }; - const CountPropertyObj = { [csdl.$Version > '4.0' ? '@count' : '@odata.count']: ref('count') }; + const countProperty = { [csdl.$Version > '4.0' ? '@count' : '@odata.count']: ref('count') }; const nextLinkKey = csdl.$Version > '4.0' ? '@nextLink' : '@odata.nextLink'; - const NextLinkPropertyObj = { + const nextLinkProperty = { [nextLinkKey]: { type: 'string', format: 'uri', @@ -1929,9 +1929,9 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot type: 'object', title: `Collection of ${nameParts(type.$Type ? type.$Type : 'Edm.String').name}`, properties: { - ...(isCount && CountPropertyObj), + ...(isCount && countProperty), value: s, - ...NextLinkPropertyObj + ...nextLinkProperty } }; }