From 6bb870d2928bb849538f0c8cb49bc4e19c018bd6 Mon Sep 17 00:00:00 2001 From: esd Date: Sun, 29 Mar 2020 21:49:25 +0200 Subject: [PATCH] feat: adds odata metadata to entity type fixes #60 --- lib/csdl2openapi.js | 3 +- tools/V4-CSDL-to-OpenAPI.xsl | 17 + .../Northwind-key-as-segment.openapi3.json | 208 + .../Northwind-key-as-segment.swagger.json | 208 + tools/tests/TripPin.openapi3.json | 72 + tools/tests/TripPin.swagger.json | 72 + tools/tests/annotations-v2.openapi3.json | 19 + tools/tests/annotations-v2.swagger.json | 19 + tools/tests/annotations.openapi3.json | 16 + tools/tests/annotations.swagger.json | 16 + tools/tests/authorization.openapi3.json | 8 + tools/tests/authorization.swagger.json | 8 + tools/tests/containment.openapi3.json | 32 + tools/tests/containment.swagger.json | 32 + tools/tests/csdl-16.1.openapi3.json | 32 + tools/tests/csdl-16.1.swagger.json | 32 + tools/tests/descriptions.openapi3.json | 8 + tools/tests/descriptions.swagger.json | 8 + tools/tests/odata-rw-v2.openapi3.json | 57 + tools/tests/odata-rw-v2.swagger.json | 57 + tools/tests/odata-rw-v3.V4.openapi3.json | 4432 +++++++++++++++++ tools/tests/odata-rw-v3.V4.swagger.json | 3917 +++++++++++++++ tools/tests/odata-rw-v3.openapi3.json | 80 + tools/tests/odata-rw-v3.swagger.json | 80 + 24 files changed, 9432 insertions(+), 1 deletion(-) create mode 100644 tools/tests/odata-rw-v3.V4.openapi3.json create mode 100644 tools/tests/odata-rw-v3.V4.swagger.json diff --git a/lib/csdl2openapi.js b/lib/csdl2openapi.js index dfeab6f5..7e3ae763 100644 --- a/lib/csdl2openapi.js +++ b/lib/csdl2openapi.js @@ -1483,7 +1483,8 @@ module.exports.csdl2openapi = function ( const updName = allName + '-update'; const isKey = keyMap(type); const required = Object.keys(isKey); - const allProperties = {}; + const metadata = { '@odata.id':{ type: "string", readOnly: true }, '@odata.etag': { type: 'string', readOnly: true, example: "W/\"08D7D40891852C76\"" } }; + const allProperties = { ...metadata }; const creProperties = {}; const updProperties = {}; diff --git a/tools/V4-CSDL-to-OpenAPI.xsl b/tools/V4-CSDL-to-OpenAPI.xsl index fa842f44..fd30f0b3 100644 --- a/tools/V4-CSDL-to-OpenAPI.xsl +++ b/tools/V4-CSDL-to-OpenAPI.xsl @@ -1416,6 +1416,23 @@ ,"properties":{ + + + + + "__metadata":{ + "type":"object", + "readOnly":true, + "description":"This name/value pair is not data, but instead, specifies the metadata for the EntityType instance that the JSON object represents.", + "properties":{"id":{"type":"string"},"uri":{"type":"string"},"type":{"type":"string"},"etag":{"type":"string","example":"W/\"time(123456789)\""}} + }, + + + + "@odata.id":{"type":"string","readOnly":true},"@odata.etag":{"type":"string","readOnly":true,"example":"W/\"08D7D40891852C76\""}, + + + diff --git a/tools/tests/Northwind-key-as-segment.openapi3.json b/tools/tests/Northwind-key-as-segment.openapi3.json index 872e078e..cd74338f 100644 --- a/tools/tests/Northwind-key-as-segment.openapi3.json +++ b/tools/tests/Northwind-key-as-segment.openapi3.json @@ -9999,6 +9999,14 @@ "NorthwindModel.Category": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "CategoryID": { "type": "integer", "format": "int32" @@ -10079,6 +10087,14 @@ "NorthwindModel.CustomerDemographic": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "CustomerTypeID": { "type": "string", "maxLength": 10 @@ -10132,6 +10148,14 @@ "NorthwindModel.Customer": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "CustomerID": { "type": "string", "maxLength": 5 @@ -10332,6 +10356,14 @@ "NorthwindModel.Employee": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "EmployeeID": { "type": "integer", "format": "int32" @@ -10665,6 +10697,14 @@ "NorthwindModel.Order_Detail": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "OrderID": { "type": "integer", "format": "int32" @@ -10802,6 +10842,14 @@ "NorthwindModel.Order": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "OrderID": { "type": "integer", "format": "int32" @@ -11122,6 +11170,14 @@ "NorthwindModel.Product": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ProductID": { "type": "integer", "format": "int32" @@ -11348,6 +11404,14 @@ "NorthwindModel.Region": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "RegionID": { "type": "integer", "format": "int32" @@ -11401,6 +11465,14 @@ "NorthwindModel.Shipper": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ShipperID": { "type": "integer", "format": "int32" @@ -11469,6 +11541,14 @@ "NorthwindModel.Supplier": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "SupplierID": { "type": "integer", "format": "int32" @@ -11669,6 +11749,14 @@ "NorthwindModel.Territory": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "TerritoryID": { "type": "string", "maxLength": 20 @@ -11740,6 +11828,14 @@ "NorthwindModel.Alphabetical_list_of_product": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ProductID": { "type": "integer", "format": "int32" @@ -11926,6 +12022,14 @@ "NorthwindModel.Category_Sales_for_1997": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "CategoryName": { "type": "string", "maxLength": 15 @@ -11997,6 +12101,14 @@ "NorthwindModel.Current_Product_List": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ProductID": { "type": "integer", "format": "int32" @@ -12033,6 +12145,14 @@ "NorthwindModel.Customer_and_Suppliers_by_City": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "City": { "type": "string", "nullable": true, @@ -12101,6 +12221,14 @@ "NorthwindModel.Invoice": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ShipName": { "type": "string", "nullable": true, @@ -12554,6 +12682,14 @@ "NorthwindModel.Order_Details_Extended": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "OrderID": { "type": "integer", "format": "int32" @@ -12704,6 +12840,14 @@ "NorthwindModel.Order_Subtotal": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "OrderID": { "type": "integer", "format": "int32" @@ -12775,6 +12919,14 @@ "NorthwindModel.Orders_Qry": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "OrderID": { "type": "integer", "format": "int32" @@ -13119,6 +13271,14 @@ "NorthwindModel.Product_Sales_for_1997": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "CategoryName": { "type": "string", "maxLength": 15 @@ -13199,6 +13359,14 @@ "NorthwindModel.Products_Above_Average_Price": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ProductName": { "type": "string", "maxLength": 40 @@ -13270,6 +13438,14 @@ "NorthwindModel.Products_by_Category": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "CategoryName": { "type": "string", "maxLength": 15 @@ -13345,6 +13521,14 @@ "NorthwindModel.Sales_by_Category": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "CategoryID": { "type": "integer", "format": "int32" @@ -13434,6 +13618,14 @@ "NorthwindModel.Sales_Totals_by_Amount": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "SaleAmount": { "anyOf": [ { @@ -13532,6 +13724,14 @@ "NorthwindModel.Summary_of_Sales_by_Quarter": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ShippedDate": { "type": "string", "nullable": true, @@ -13621,6 +13821,14 @@ "NorthwindModel.Summary_of_Sales_by_Year": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ShippedDate": { "type": "string", "nullable": true, diff --git a/tools/tests/Northwind-key-as-segment.swagger.json b/tools/tests/Northwind-key-as-segment.swagger.json index ead3367a..651a50de 100644 --- a/tools/tests/Northwind-key-as-segment.swagger.json +++ b/tools/tests/Northwind-key-as-segment.swagger.json @@ -8719,6 +8719,14 @@ "NorthwindModel.Category": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "CategoryID": { "type": "integer", "format": "int32" @@ -8814,6 +8822,14 @@ "NorthwindModel.CustomerDemographic": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "CustomerTypeID": { "type": "string", "maxLength": 10 @@ -8876,6 +8892,14 @@ "NorthwindModel.Customer": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "CustomerID": { "type": "string", "maxLength": 5 @@ -9157,6 +9181,14 @@ "NorthwindModel.Employee": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "EmployeeID": { "type": "integer", "format": "int32" @@ -9603,6 +9635,14 @@ "NorthwindModel.Order_Detail": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "OrderID": { "type": "integer", "format": "int32" @@ -9716,6 +9756,14 @@ "NorthwindModel.Order": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "OrderID": { "type": "integer", "format": "int32" @@ -10087,6 +10135,14 @@ "NorthwindModel.Product": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ProductID": { "type": "integer", "format": "int32" @@ -10320,6 +10376,14 @@ "NorthwindModel.Region": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "RegionID": { "type": "integer", "format": "int32" @@ -10373,6 +10437,14 @@ "NorthwindModel.Shipper": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ShipperID": { "type": "integer", "format": "int32" @@ -10450,6 +10522,14 @@ "NorthwindModel.Supplier": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "SupplierID": { "type": "integer", "format": "int32" @@ -10740,6 +10820,14 @@ "NorthwindModel.Territory": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "TerritoryID": { "type": "string", "maxLength": 20 @@ -10811,6 +10899,14 @@ "NorthwindModel.Alphabetical_list_of_product": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ProductID": { "type": "integer", "format": "int32" @@ -11024,6 +11120,14 @@ "NorthwindModel.Category_Sales_for_1997": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "CategoryName": { "type": "string", "maxLength": 15 @@ -11083,6 +11187,14 @@ "NorthwindModel.Current_Product_List": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ProductID": { "type": "integer", "format": "int32" @@ -11119,6 +11231,14 @@ "NorthwindModel.Customer_and_Suppliers_by_City": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "City": { "type": [ "string", @@ -11205,6 +11325,14 @@ "NorthwindModel.Invoice": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ShipName": { "type": [ "string", @@ -11744,6 +11872,14 @@ "NorthwindModel.Order_Details_Extended": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "OrderID": { "type": "integer", "format": "int32" @@ -11866,6 +12002,14 @@ "NorthwindModel.Order_Subtotal": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "OrderID": { "type": "integer", "format": "int32" @@ -11925,6 +12069,14 @@ "NorthwindModel.Orders_Qry": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "OrderID": { "type": "integer", "format": "int32" @@ -12395,6 +12547,14 @@ "NorthwindModel.Product_Sales_for_1997": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "CategoryName": { "type": "string", "maxLength": 15 @@ -12463,6 +12623,14 @@ "NorthwindModel.Products_Above_Average_Price": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ProductName": { "type": "string", "maxLength": 40 @@ -12522,6 +12690,14 @@ "NorthwindModel.Products_by_Category": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "CategoryName": { "type": "string", "maxLength": 15 @@ -12612,6 +12788,14 @@ "NorthwindModel.Sales_by_Category": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "CategoryID": { "type": "integer", "format": "int32" @@ -12689,6 +12873,14 @@ "NorthwindModel.Sales_Totals_by_Amount": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "SaleAmount": { "type": [ "number", @@ -12781,6 +12973,14 @@ "NorthwindModel.Summary_of_Sales_by_Quarter": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ShippedDate": { "type": [ "string", @@ -12864,6 +13064,14 @@ "NorthwindModel.Summary_of_Sales_by_Year": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ShippedDate": { "type": [ "string", diff --git a/tools/tests/TripPin.openapi3.json b/tools/tests/TripPin.openapi3.json index 0dbb81fd..a7d89798 100644 --- a/tools/tests/TripPin.openapi3.json +++ b/tools/tests/TripPin.openapi3.json @@ -3390,6 +3390,14 @@ "Microsoft.OData.SampleService.Models.TripPin.Photo": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "Id": { "anyOf": [ { @@ -3432,6 +3440,14 @@ "Microsoft.OData.SampleService.Models.TripPin.Person": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "UserName": { "type": "string" }, @@ -3583,6 +3599,14 @@ "Microsoft.OData.SampleService.Models.TripPin.Airline": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "AirlineCode": { "type": "string" }, @@ -3613,6 +3637,14 @@ "Microsoft.OData.SampleService.Models.TripPin.Airport": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "IcaoCode": { "type": "string" }, @@ -3658,6 +3690,14 @@ "Microsoft.OData.SampleService.Models.TripPin.PlanItem": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "PlanItemId": { "type": "integer", "format": "int32" @@ -3779,6 +3819,14 @@ "Microsoft.OData.SampleService.Models.TripPin.PublicTransportation": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "PlanItemId": { "type": "integer", "format": "int32" @@ -3903,6 +3951,14 @@ "Microsoft.OData.SampleService.Models.TripPin.Flight": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "PlanItemId": { "type": "integer", "format": "int32" @@ -4030,6 +4086,14 @@ "Microsoft.OData.SampleService.Models.TripPin.Event": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "PlanItemId": { "type": "integer", "format": "int32" @@ -4139,6 +4203,14 @@ "Microsoft.OData.SampleService.Models.TripPin.Trip": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "TripId": { "type": "integer", "format": "int32" diff --git a/tools/tests/TripPin.swagger.json b/tools/tests/TripPin.swagger.json index 211c663d..f3c48493 100644 --- a/tools/tests/TripPin.swagger.json +++ b/tools/tests/TripPin.swagger.json @@ -2954,6 +2954,14 @@ "Microsoft.OData.SampleService.Models.TripPin.Photo": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "Id": { "type": [ "integer", @@ -3001,6 +3009,14 @@ "Microsoft.OData.SampleService.Models.TripPin.Person": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "UserName": { "type": "string" }, @@ -3123,6 +3139,14 @@ "Microsoft.OData.SampleService.Models.TripPin.Airline": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "AirlineCode": { "type": "string" }, @@ -3153,6 +3177,14 @@ "Microsoft.OData.SampleService.Models.TripPin.Airport": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "IcaoCode": { "type": "string" }, @@ -3198,6 +3230,14 @@ "Microsoft.OData.SampleService.Models.TripPin.PlanItem": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "PlanItemId": { "type": "integer", "format": "int32" @@ -3313,6 +3353,14 @@ "Microsoft.OData.SampleService.Models.TripPin.PublicTransportation": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "PlanItemId": { "type": "integer", "format": "int32" @@ -3449,6 +3497,14 @@ "Microsoft.OData.SampleService.Models.TripPin.Flight": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "PlanItemId": { "type": "integer", "format": "int32" @@ -3612,6 +3668,14 @@ "Microsoft.OData.SampleService.Models.TripPin.Event": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "PlanItemId": { "type": "integer", "format": "int32" @@ -3757,6 +3821,14 @@ "Microsoft.OData.SampleService.Models.TripPin.Trip": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "TripId": { "type": "integer", "format": "int32" diff --git a/tools/tests/annotations-v2.openapi3.json b/tools/tests/annotations-v2.openapi3.json index 41a2eede..81bbb6c7 100644 --- a/tools/tests/annotations-v2.openapi3.json +++ b/tools/tests/annotations-v2.openapi3.json @@ -13,6 +13,25 @@ "Supported.Annotations.SinglePartKey": { "type": "object", "properties": { + "__metadata": { + "type": "object", + "readOnly": true, + "description": "This name/value pair is not data, but instead, specifies the metadata for the EntityType instance that the JSON object represents.", + "properties": { + "id": { + "type": "string" + }, + "uri": { + "type": "string" + }, + "type": { + "type": "string" + }, + "etag": { + "type": "string" + } + } + }, "ID": { "type": "string" }, diff --git a/tools/tests/annotations-v2.swagger.json b/tools/tests/annotations-v2.swagger.json index 00336998..c956c353 100644 --- a/tools/tests/annotations-v2.swagger.json +++ b/tools/tests/annotations-v2.swagger.json @@ -12,6 +12,25 @@ "Supported.Annotations.SinglePartKey": { "type": "object", "properties": { + "__metadata": { + "type": "object", + "readOnly": true, + "description": "This name/value pair is not data, but instead, specifies the metadata for the EntityType instance that the JSON object represents.", + "properties": { + "id": { + "type": "string" + }, + "uri": { + "type": "string" + }, + "type": { + "type": "string" + }, + "etag": { + "type": "string" + } + } + }, "ID": { "type": "string" }, diff --git a/tools/tests/annotations.openapi3.json b/tools/tests/annotations.openapi3.json index 7c5e6dfd..374996c8 100644 --- a/tools/tests/annotations.openapi3.json +++ b/tools/tests/annotations.openapi3.json @@ -2554,6 +2554,14 @@ "Supported.Annotations.SinglePartKey": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ID": { "type": "string" }, @@ -2998,6 +3006,14 @@ "Supported.Annotations.TwoPartKey": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "One": { "type": "integer", "format": "int32" diff --git a/tools/tests/annotations.swagger.json b/tools/tests/annotations.swagger.json index ed377752..3d0b8fb3 100644 --- a/tools/tests/annotations.swagger.json +++ b/tools/tests/annotations.swagger.json @@ -2250,6 +2250,14 @@ "Supported.Annotations.SinglePartKey": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ID": { "type": "string" }, @@ -2691,6 +2699,14 @@ "Supported.Annotations.TwoPartKey": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "One": { "type": "integer", "format": "int32" diff --git a/tools/tests/authorization.openapi3.json b/tools/tests/authorization.openapi3.json index 51a9b20f..a49e78a1 100644 --- a/tools/tests/authorization.openapi3.json +++ b/tools/tests/authorization.openapi3.json @@ -273,6 +273,14 @@ "auth.example.Person": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ID": { "type": "string" }, diff --git a/tools/tests/authorization.swagger.json b/tools/tests/authorization.swagger.json index 94454678..aad49b01 100644 --- a/tools/tests/authorization.swagger.json +++ b/tools/tests/authorization.swagger.json @@ -252,6 +252,14 @@ "auth.example.Person": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ID": { "type": "string" }, diff --git a/tools/tests/containment.openapi3.json b/tools/tests/containment.openapi3.json index 2147409e..6637a66b 100644 --- a/tools/tests/containment.openapi3.json +++ b/tools/tests/containment.openapi3.json @@ -4900,6 +4900,14 @@ "Containment.Whole": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ID": { "type": "string" }, @@ -4967,6 +4975,14 @@ "Containment.Part": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "index": { "type": "integer", "format": "int32" @@ -5046,6 +5062,14 @@ "Containment.SubPart": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "One": { "type": "integer", "format": "int32" @@ -5082,6 +5106,14 @@ "Containment.Folder": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "Name": { "type": "string" }, diff --git a/tools/tests/containment.swagger.json b/tools/tests/containment.swagger.json index e480abac..86e011d8 100644 --- a/tools/tests/containment.swagger.json +++ b/tools/tests/containment.swagger.json @@ -4280,6 +4280,14 @@ "Containment.Whole": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ID": { "type": "string" }, @@ -4346,6 +4354,14 @@ "Containment.Part": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "index": { "type": "integer", "format": "int32" @@ -4415,6 +4431,14 @@ "Containment.SubPart": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "One": { "type": "integer", "format": "int32" @@ -4451,6 +4475,14 @@ "Containment.Folder": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "Name": { "type": "string" }, diff --git a/tools/tests/csdl-16.1.openapi3.json b/tools/tests/csdl-16.1.openapi3.json index 9e2cbbd9..d830e092 100644 --- a/tools/tests/csdl-16.1.openapi3.json +++ b/tools/tests/csdl-16.1.openapi3.json @@ -1830,6 +1830,14 @@ "ODataDemo.Product": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ID": { "type": "string" }, @@ -1999,6 +2007,14 @@ "ODataDemo.Category": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ID": { "type": "integer", "format": "int32" @@ -2049,6 +2065,14 @@ "ODataDemo.Supplier": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ID": { "type": "string" }, @@ -2121,6 +2145,14 @@ "ODataDemo.Country": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "Code": { "type": "string", "maxLength": 2 diff --git a/tools/tests/csdl-16.1.swagger.json b/tools/tests/csdl-16.1.swagger.json index 9cd603c9..0bc8ef0b 100644 --- a/tools/tests/csdl-16.1.swagger.json +++ b/tools/tests/csdl-16.1.swagger.json @@ -1603,6 +1603,14 @@ "ODataDemo.Product": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ID": { "type": "string" }, @@ -1786,6 +1794,14 @@ "ODataDemo.Category": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ID": { "type": "integer", "format": "int32" @@ -1836,6 +1852,14 @@ "ODataDemo.Supplier": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ID": { "type": "string" }, @@ -1917,6 +1941,14 @@ "ODataDemo.Country": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "Code": { "type": "string", "maxLength": 2 diff --git a/tools/tests/descriptions.openapi3.json b/tools/tests/descriptions.openapi3.json index 5fb8ae2f..f31abe9b 100644 --- a/tools/tests/descriptions.openapi3.json +++ b/tools/tests/descriptions.openapi3.json @@ -1323,6 +1323,14 @@ "descriptions.entity": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "id": { "type": "string", "maxLength": 70, diff --git a/tools/tests/descriptions.swagger.json b/tools/tests/descriptions.swagger.json index a1621c6f..46acb4f8 100644 --- a/tools/tests/descriptions.swagger.json +++ b/tools/tests/descriptions.swagger.json @@ -1227,6 +1227,14 @@ "descriptions.entity": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "id": { "type": "string", "maxLength": 70, diff --git a/tools/tests/odata-rw-v2.openapi3.json b/tools/tests/odata-rw-v2.openapi3.json index 9009aff5..342d64ed 100644 --- a/tools/tests/odata-rw-v2.openapi3.json +++ b/tools/tests/odata-rw-v2.openapi3.json @@ -1472,6 +1472,25 @@ "ODataDemo.Product": { "type": "object", "properties": { + "__metadata": { + "type": "object", + "readOnly": true, + "description": "This name/value pair is not data, but instead, specifies the metadata for the EntityType instance that the JSON object represents.", + "properties": { + "id": { + "type": "string" + }, + "uri": { + "type": "string" + }, + "type": { + "type": "string" + }, + "etag": { + "type": "string" + } + } + }, "ID": { "type": "integer", "format": "int32" @@ -1614,6 +1633,25 @@ "ODataDemo.Category": { "type": "object", "properties": { + "__metadata": { + "type": "object", + "readOnly": true, + "description": "This name/value pair is not data, but instead, specifies the metadata for the EntityType instance that the JSON object represents.", + "properties": { + "id": { + "type": "string" + }, + "uri": { + "type": "string" + }, + "type": { + "type": "string" + }, + "etag": { + "type": "string" + } + } + }, "ID": { "type": "integer", "format": "int32" @@ -1677,6 +1715,25 @@ "ODataDemo.Supplier": { "type": "object", "properties": { + "__metadata": { + "type": "object", + "readOnly": true, + "description": "This name/value pair is not data, but instead, specifies the metadata for the EntityType instance that the JSON object represents.", + "properties": { + "id": { + "type": "string" + }, + "uri": { + "type": "string" + }, + "type": { + "type": "string" + }, + "etag": { + "type": "string" + } + } + }, "ID": { "type": "integer", "format": "int32" diff --git a/tools/tests/odata-rw-v2.swagger.json b/tools/tests/odata-rw-v2.swagger.json index ffbbc29c..9062758f 100644 --- a/tools/tests/odata-rw-v2.swagger.json +++ b/tools/tests/odata-rw-v2.swagger.json @@ -1305,6 +1305,25 @@ "ODataDemo.Product": { "type": "object", "properties": { + "__metadata": { + "type": "object", + "readOnly": true, + "description": "This name/value pair is not data, but instead, specifies the metadata for the EntityType instance that the JSON object represents.", + "properties": { + "id": { + "type": "string" + }, + "uri": { + "type": "string" + }, + "type": { + "type": "string" + }, + "etag": { + "type": "string" + } + } + }, "ID": { "type": "integer", "format": "int32" @@ -1451,6 +1470,25 @@ "ODataDemo.Category": { "type": "object", "properties": { + "__metadata": { + "type": "object", + "readOnly": true, + "description": "This name/value pair is not data, but instead, specifies the metadata for the EntityType instance that the JSON object represents.", + "properties": { + "id": { + "type": "string" + }, + "uri": { + "type": "string" + }, + "type": { + "type": "string" + }, + "etag": { + "type": "string" + } + } + }, "ID": { "type": "integer", "format": "int32" @@ -1523,6 +1561,25 @@ "ODataDemo.Supplier": { "type": "object", "properties": { + "__metadata": { + "type": "object", + "readOnly": true, + "description": "This name/value pair is not data, but instead, specifies the metadata for the EntityType instance that the JSON object represents.", + "properties": { + "id": { + "type": "string" + }, + "uri": { + "type": "string" + }, + "type": { + "type": "string" + }, + "etag": { + "type": "string" + } + } + }, "ID": { "type": "integer", "format": "int32" diff --git a/tools/tests/odata-rw-v3.V4.openapi3.json b/tools/tests/odata-rw-v3.V4.openapi3.json new file mode 100644 index 00000000..ee7bc40a --- /dev/null +++ b/tools/tests/odata-rw-v3.V4.openapi3.json @@ -0,0 +1,4432 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Service for namespace ODataDemo", + "version": "", + "description": "This service is located at [https://localhost/service-root/](https://localhost/service-root/)\n\n## Entity Data Model\n![ER Diagram](https://yuml.me/diagram/class/[Product{bg:orange}],[Product]-*>[Category],[Product]-0..1>[Supplier],[Product]-0..1>[ProductDetail],[Product]^[FeaturedProduct{bg:orange}],[FeaturedProduct]-0..1>[Advertisement],[ProductDetail{bg:orange}],[ProductDetail]-0..1>[Product],[Category{bg:orange}],[Category]-*>[Product],[Supplier{bg:orange}],[Supplier]++-0..1[Address],[Supplier]-*>[Product],[Address],[Person{bg:orange}],[Person]-0..1>[PersonDetail],[Person]^[Customer{bg:orange}],[Person]^[Employee{bg:orange}],[PersonDetail{bg:orange}],[PersonDetail]++-0..1[Address],[PersonDetail]-0..1>[Person],[Advertisement{bg:orange}],[Advertisement]-0..1>[FeaturedProduct],[Products{bg:dodgerblue}]++-*>[Product],[ProductDetails{bg:dodgerblue}]++-*>[ProductDetail],[Categories{bg:dodgerblue}]++-*>[Category],[Suppliers{bg:dodgerblue}]++-*>[Supplier],[Persons{bg:dodgerblue}]++-*>[Person],[PersonDetails{bg:dodgerblue}]++-*>[PersonDetail],[Advertisements{bg:dodgerblue}]++-*>[Advertisement],[GetProductsByRating{bg:dodgerblue}]-*>[Product],[IncreaseSalaries{bg:dodgerblue}])\n\n### Legend\n![Legend](https://yuml.me/diagram/plain;dir:TB;scale:60/class/[External.Type{bg:whitesmoke}],[ComplexType],[EntityType{bg:orange}],[EntitySet/Singleton/Operation{bg:dodgerblue}])" + }, + "servers": [ + { + "url": "https://localhost/service-root" + } + ], + "tags": [ + { + "name": "Products" + }, + { + "name": "ProductDetails" + }, + { + "name": "Categories" + }, + { + "name": "Suppliers" + }, + { + "name": "Persons" + }, + { + "name": "PersonDetails" + }, + { + "name": "Advertisements" + } + ], + "paths": { + "/Products": { + "get": { + "summary": "Get entities from Products", + "tags": [ + "Products" + ], + "parameters": [ + { + "$ref": "#/components/parameters/top" + }, + { + "$ref": "#/components/parameters/skip" + }, + { + "name": "$filter", + "in": "query", + "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)", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/count" + }, + { + "name": "$orderby", + "in": "query", + "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)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "ID desc", + "Name", + "Name desc", + "Description", + "Description desc", + "ReleaseDate", + "ReleaseDate desc", + "DiscontinuedDate", + "DiscontinuedDate desc", + "Rating", + "Rating desc", + "Price", + "Price desc" + ] + } + } + }, + { + "name": "$select", + "in": "query", + "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)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Name", + "Description", + "ReleaseDate", + "DiscontinuedDate", + "Rating", + "Price" + ] + } + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Categories", + "Supplier", + "ProductDetail" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved entities", + "content": { + "application/json": { + "schema": { + "title": "Collection of Product", + "type": "object", + "properties": { + "@odata.count": { + "type": "number", + "description": "The count name/value pair represents the number of entities in the collection. Available when using the [$count](http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part1-protocol.html#_The_$inlinecount_System) query option." + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ODataDemo.Product" + } + } + } + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "post": { + "summary": "Add new entity to Products", + "tags": [ + "Products" + ], + "requestBody": { + "required": true, + "description": "New entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ODataDemo.Product-create" + } + } + } + }, + "responses": { + "201": { + "description": "Created entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ODataDemo.Product" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + } + }, + "/Products({ID})": { + "parameters": [ + { + "name": "ID", + "in": "path", + "required": true, + "description": "key: ID", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "get": { + "summary": "Get entity from Products by key", + "tags": [ + "Products" + ], + "parameters": [ + { + "name": "$select", + "in": "query", + "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)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Name", + "Description", + "ReleaseDate", + "DiscontinuedDate", + "Rating", + "Price" + ] + } + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Categories", + "Supplier", + "ProductDetail" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ODataDemo.Product" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "patch": { + "summary": "Update entity in Products", + "tags": [ + "Products" + ], + "requestBody": { + "required": true, + "description": "New property values", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ODataDemo.Product-update" + } + } + } + }, + "responses": { + "204": { + "description": "Success" + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "delete": { + "summary": "Delete entity from Products", + "tags": [ + "Products" + ], + "responses": { + "204": { + "description": "Success" + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + } + }, + "/Products({ID})/ODataDemo.Discount": { + "post": { + "summary": "Invoke action Discount", + "tags": [ + "Products" + ], + "parameters": [ + { + "name": "ID", + "in": "path", + "required": true, + "description": "key: ID", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "requestBody": { + "description": "Action parameters", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "discountPercentage": { + "type": "integer", + "format": "int32" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "format": "double", + "example": 3.14 + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + } + }, + "/Products({ID})/Categories": { + "parameters": [ + { + "name": "ID", + "in": "path", + "required": true, + "description": "key: ID", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "get": { + "summary": "Get entities from related Categories", + "tags": [ + "Products", + "Categories" + ], + "parameters": [ + { + "$ref": "#/components/parameters/top" + }, + { + "$ref": "#/components/parameters/skip" + }, + { + "name": "$filter", + "in": "query", + "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)", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/count" + }, + { + "name": "$orderby", + "in": "query", + "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)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "ID desc", + "Name", + "Name desc" + ] + } + } + }, + { + "name": "$select", + "in": "query", + "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)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Name" + ] + } + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Products" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved entities", + "content": { + "application/json": { + "schema": { + "title": "Collection of Category", + "type": "object", + "properties": { + "@odata.count": { + "type": "number", + "description": "The count name/value pair represents the number of entities in the collection. Available when using the [$count](http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part1-protocol.html#_The_$inlinecount_System) query option." + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ODataDemo.Category" + } + } + } + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "post": { + "summary": "Add new entity to related Categories", + "tags": [ + "Products", + "Categories" + ], + "requestBody": { + "required": true, + "description": "New entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ODataDemo.Category-create" + } + } + } + }, + "responses": { + "201": { + "description": "Created entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ODataDemo.Category" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + } + }, + "/Products({ID})/Supplier": { + "parameters": [ + { + "name": "ID", + "in": "path", + "required": true, + "description": "key: ID", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "get": { + "summary": "Get related Supplier", + "tags": [ + "Products", + "Suppliers" + ], + "parameters": [ + { + "name": "$select", + "in": "query", + "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)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Name", + "Address", + "Location", + "Concurrency" + ] + } + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Products" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ODataDemo.Supplier" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + } + }, + "/Products({ID})/ProductDetail": { + "parameters": [ + { + "name": "ID", + "in": "path", + "required": true, + "description": "key: ID", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "get": { + "summary": "Get related ProductDetail", + "tags": [ + "Products", + "ProductDetails" + ], + "parameters": [ + { + "name": "$select", + "in": "query", + "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)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ProductID", + "Details" + ] + } + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Product" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ODataDemo.ProductDetail" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + } + }, + "/ProductDetails": { + "get": { + "summary": "Get entities from ProductDetails", + "tags": [ + "ProductDetails" + ], + "parameters": [ + { + "$ref": "#/components/parameters/top" + }, + { + "$ref": "#/components/parameters/skip" + }, + { + "name": "$filter", + "in": "query", + "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)", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/count" + }, + { + "name": "$orderby", + "in": "query", + "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)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ProductID", + "ProductID desc", + "Details", + "Details desc" + ] + } + } + }, + { + "name": "$select", + "in": "query", + "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)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ProductID", + "Details" + ] + } + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Product" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved entities", + "content": { + "application/json": { + "schema": { + "title": "Collection of ProductDetail", + "type": "object", + "properties": { + "@odata.count": { + "type": "number", + "description": "The count name/value pair represents the number of entities in the collection. Available when using the [$count](http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part1-protocol.html#_The_$inlinecount_System) query option." + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ODataDemo.ProductDetail" + } + } + } + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "post": { + "summary": "Add new entity to ProductDetails", + "tags": [ + "ProductDetails" + ], + "requestBody": { + "required": true, + "description": "New entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ODataDemo.ProductDetail-create" + } + } + } + }, + "responses": { + "201": { + "description": "Created entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ODataDemo.ProductDetail" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + } + }, + "/ProductDetails({ProductID})": { + "parameters": [ + { + "name": "ProductID", + "in": "path", + "required": true, + "description": "key: ProductID", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "get": { + "summary": "Get entity from ProductDetails by key", + "tags": [ + "ProductDetails" + ], + "parameters": [ + { + "name": "$select", + "in": "query", + "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)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ProductID", + "Details" + ] + } + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Product" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ODataDemo.ProductDetail" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "patch": { + "summary": "Update entity in ProductDetails", + "tags": [ + "ProductDetails" + ], + "requestBody": { + "required": true, + "description": "New property values", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ODataDemo.ProductDetail-update" + } + } + } + }, + "responses": { + "204": { + "description": "Success" + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "delete": { + "summary": "Delete entity from ProductDetails", + "tags": [ + "ProductDetails" + ], + "responses": { + "204": { + "description": "Success" + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + } + }, + "/ProductDetails({ProductID})/Product": { + "parameters": [ + { + "name": "ProductID", + "in": "path", + "required": true, + "description": "key: ProductID", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "get": { + "summary": "Get related Product", + "tags": [ + "ProductDetails", + "Products" + ], + "parameters": [ + { + "name": "$select", + "in": "query", + "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)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Name", + "Description", + "ReleaseDate", + "DiscontinuedDate", + "Rating", + "Price" + ] + } + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Categories", + "Supplier", + "ProductDetail" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ODataDemo.Product" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + } + }, + "/ProductDetails({ProductID})/Product/ODataDemo.Discount": { + "post": { + "summary": "Invoke action Discount", + "tags": [ + "ProductDetails" + ], + "parameters": [ + { + "name": "ProductID", + "in": "path", + "required": true, + "description": "key: ProductID", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "requestBody": { + "description": "Action parameters", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "discountPercentage": { + "type": "integer", + "format": "int32" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "format": "double", + "example": 3.14 + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + } + }, + "/Categories": { + "get": { + "summary": "Get entities from Categories", + "tags": [ + "Categories" + ], + "parameters": [ + { + "$ref": "#/components/parameters/top" + }, + { + "$ref": "#/components/parameters/skip" + }, + { + "name": "$filter", + "in": "query", + "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)", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/count" + }, + { + "name": "$orderby", + "in": "query", + "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)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "ID desc", + "Name", + "Name desc" + ] + } + } + }, + { + "name": "$select", + "in": "query", + "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)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Name" + ] + } + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Products" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved entities", + "content": { + "application/json": { + "schema": { + "title": "Collection of Category", + "type": "object", + "properties": { + "@odata.count": { + "type": "number", + "description": "The count name/value pair represents the number of entities in the collection. Available when using the [$count](http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part1-protocol.html#_The_$inlinecount_System) query option." + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ODataDemo.Category" + } + } + } + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "post": { + "summary": "Add new entity to Categories", + "tags": [ + "Categories" + ], + "requestBody": { + "required": true, + "description": "New entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ODataDemo.Category-create" + } + } + } + }, + "responses": { + "201": { + "description": "Created entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ODataDemo.Category" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + } + }, + "/Categories({ID})": { + "parameters": [ + { + "name": "ID", + "in": "path", + "required": true, + "description": "key: ID", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "get": { + "summary": "Get entity from Categories by key", + "tags": [ + "Categories" + ], + "parameters": [ + { + "name": "$select", + "in": "query", + "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)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Name" + ] + } + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Products" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ODataDemo.Category" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "patch": { + "summary": "Update entity in Categories", + "tags": [ + "Categories" + ], + "requestBody": { + "required": true, + "description": "New property values", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ODataDemo.Category-update" + } + } + } + }, + "responses": { + "204": { + "description": "Success" + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "delete": { + "summary": "Delete entity from Categories", + "tags": [ + "Categories" + ], + "responses": { + "204": { + "description": "Success" + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + } + }, + "/Categories({ID})/Products": { + "parameters": [ + { + "name": "ID", + "in": "path", + "required": true, + "description": "key: ID", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "get": { + "summary": "Get entities from related Products", + "tags": [ + "Categories", + "Products" + ], + "parameters": [ + { + "$ref": "#/components/parameters/top" + }, + { + "$ref": "#/components/parameters/skip" + }, + { + "name": "$filter", + "in": "query", + "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)", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/count" + }, + { + "name": "$orderby", + "in": "query", + "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)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "ID desc", + "Name", + "Name desc", + "Description", + "Description desc", + "ReleaseDate", + "ReleaseDate desc", + "DiscontinuedDate", + "DiscontinuedDate desc", + "Rating", + "Rating desc", + "Price", + "Price desc" + ] + } + } + }, + { + "name": "$select", + "in": "query", + "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)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Name", + "Description", + "ReleaseDate", + "DiscontinuedDate", + "Rating", + "Price" + ] + } + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Categories", + "Supplier", + "ProductDetail" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved entities", + "content": { + "application/json": { + "schema": { + "title": "Collection of Product", + "type": "object", + "properties": { + "@odata.count": { + "type": "number", + "description": "The count name/value pair represents the number of entities in the collection. Available when using the [$count](http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part1-protocol.html#_The_$inlinecount_System) query option." + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ODataDemo.Product" + } + } + } + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "post": { + "summary": "Add new entity to related Products", + "tags": [ + "Categories", + "Products" + ], + "requestBody": { + "required": true, + "description": "New entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ODataDemo.Product-create" + } + } + } + }, + "responses": { + "201": { + "description": "Created entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ODataDemo.Product" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + } + }, + "/Suppliers": { + "get": { + "summary": "Get entities from Suppliers", + "tags": [ + "Suppliers" + ], + "parameters": [ + { + "$ref": "#/components/parameters/top" + }, + { + "$ref": "#/components/parameters/skip" + }, + { + "name": "$filter", + "in": "query", + "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)", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/count" + }, + { + "name": "$orderby", + "in": "query", + "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)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "ID desc", + "Name", + "Name desc", + "Address", + "Address desc", + "Location", + "Location desc", + "Concurrency", + "Concurrency desc" + ] + } + } + }, + { + "name": "$select", + "in": "query", + "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)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Name", + "Address", + "Location", + "Concurrency" + ] + } + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Products" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved entities", + "content": { + "application/json": { + "schema": { + "title": "Collection of Supplier", + "type": "object", + "properties": { + "@odata.count": { + "type": "number", + "description": "The count name/value pair represents the number of entities in the collection. Available when using the [$count](http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part1-protocol.html#_The_$inlinecount_System) query option." + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ODataDemo.Supplier" + } + } + } + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "post": { + "summary": "Add new entity to Suppliers", + "tags": [ + "Suppliers" + ], + "requestBody": { + "required": true, + "description": "New entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ODataDemo.Supplier-create" + } + } + } + }, + "responses": { + "201": { + "description": "Created entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ODataDemo.Supplier" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + } + }, + "/Suppliers({ID})": { + "parameters": [ + { + "name": "ID", + "in": "path", + "required": true, + "description": "key: ID", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "get": { + "summary": "Get entity from Suppliers by key", + "tags": [ + "Suppliers" + ], + "parameters": [ + { + "name": "$select", + "in": "query", + "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)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Name", + "Address", + "Location", + "Concurrency" + ] + } + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Products" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ODataDemo.Supplier" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "patch": { + "summary": "Update entity in Suppliers", + "tags": [ + "Suppliers" + ], + "requestBody": { + "required": true, + "description": "New property values", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ODataDemo.Supplier-update" + } + } + } + }, + "responses": { + "204": { + "description": "Success" + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "delete": { + "summary": "Delete entity from Suppliers", + "tags": [ + "Suppliers" + ], + "responses": { + "204": { + "description": "Success" + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + } + }, + "/Suppliers({ID})/Products": { + "parameters": [ + { + "name": "ID", + "in": "path", + "required": true, + "description": "key: ID", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "get": { + "summary": "Get entities from related Products", + "tags": [ + "Suppliers", + "Products" + ], + "parameters": [ + { + "$ref": "#/components/parameters/top" + }, + { + "$ref": "#/components/parameters/skip" + }, + { + "name": "$filter", + "in": "query", + "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)", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/count" + }, + { + "name": "$orderby", + "in": "query", + "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)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "ID desc", + "Name", + "Name desc", + "Description", + "Description desc", + "ReleaseDate", + "ReleaseDate desc", + "DiscontinuedDate", + "DiscontinuedDate desc", + "Rating", + "Rating desc", + "Price", + "Price desc" + ] + } + } + }, + { + "name": "$select", + "in": "query", + "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)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Name", + "Description", + "ReleaseDate", + "DiscontinuedDate", + "Rating", + "Price" + ] + } + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Categories", + "Supplier", + "ProductDetail" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved entities", + "content": { + "application/json": { + "schema": { + "title": "Collection of Product", + "type": "object", + "properties": { + "@odata.count": { + "type": "number", + "description": "The count name/value pair represents the number of entities in the collection. Available when using the [$count](http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part1-protocol.html#_The_$inlinecount_System) query option." + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ODataDemo.Product" + } + } + } + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "post": { + "summary": "Add new entity to related Products", + "tags": [ + "Suppliers", + "Products" + ], + "requestBody": { + "required": true, + "description": "New entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ODataDemo.Product-create" + } + } + } + }, + "responses": { + "201": { + "description": "Created entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ODataDemo.Product" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + } + }, + "/Persons": { + "get": { + "summary": "Get entities from Persons", + "tags": [ + "Persons" + ], + "parameters": [ + { + "$ref": "#/components/parameters/top" + }, + { + "$ref": "#/components/parameters/skip" + }, + { + "name": "$filter", + "in": "query", + "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)", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/count" + }, + { + "name": "$orderby", + "in": "query", + "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)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "ID desc", + "Name", + "Name desc" + ] + } + } + }, + { + "name": "$select", + "in": "query", + "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)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Name" + ] + } + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "PersonDetail" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved entities", + "content": { + "application/json": { + "schema": { + "title": "Collection of Person", + "type": "object", + "properties": { + "@odata.count": { + "type": "number", + "description": "The count name/value pair represents the number of entities in the collection. Available when using the [$count](http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part1-protocol.html#_The_$inlinecount_System) query option." + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ODataDemo.Person" + } + } + } + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "post": { + "summary": "Add new entity to Persons", + "tags": [ + "Persons" + ], + "requestBody": { + "required": true, + "description": "New entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ODataDemo.Person-create" + } + } + } + }, + "responses": { + "201": { + "description": "Created entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ODataDemo.Person" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + } + }, + "/Persons({ID})": { + "parameters": [ + { + "name": "ID", + "in": "path", + "required": true, + "description": "key: ID", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "get": { + "summary": "Get entity from Persons by key", + "tags": [ + "Persons" + ], + "parameters": [ + { + "name": "$select", + "in": "query", + "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)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Name" + ] + } + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "PersonDetail" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ODataDemo.Person" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "patch": { + "summary": "Update entity in Persons", + "tags": [ + "Persons" + ], + "requestBody": { + "required": true, + "description": "New property values", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ODataDemo.Person-update" + } + } + } + }, + "responses": { + "204": { + "description": "Success" + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "delete": { + "summary": "Delete entity from Persons", + "tags": [ + "Persons" + ], + "responses": { + "204": { + "description": "Success" + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + } + }, + "/Persons({ID})/PersonDetail": { + "parameters": [ + { + "name": "ID", + "in": "path", + "required": true, + "description": "key: ID", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "get": { + "summary": "Get related PersonDetail", + "tags": [ + "Persons", + "PersonDetails" + ], + "parameters": [ + { + "name": "$select", + "in": "query", + "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)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "PersonID", + "Age", + "Gender", + "Phone", + "Address", + "Photo" + ] + } + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Person" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ODataDemo.PersonDetail" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + } + }, + "/PersonDetails": { + "get": { + "summary": "Get entities from PersonDetails", + "tags": [ + "PersonDetails" + ], + "parameters": [ + { + "$ref": "#/components/parameters/top" + }, + { + "$ref": "#/components/parameters/skip" + }, + { + "name": "$filter", + "in": "query", + "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)", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/count" + }, + { + "name": "$orderby", + "in": "query", + "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)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "PersonID", + "PersonID desc", + "Age", + "Age desc", + "Gender", + "Gender desc", + "Phone", + "Phone desc", + "Address", + "Address desc", + "Photo", + "Photo desc" + ] + } + } + }, + { + "name": "$select", + "in": "query", + "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)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "PersonID", + "Age", + "Gender", + "Phone", + "Address", + "Photo" + ] + } + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Person" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved entities", + "content": { + "application/json": { + "schema": { + "title": "Collection of PersonDetail", + "type": "object", + "properties": { + "@odata.count": { + "type": "number", + "description": "The count name/value pair represents the number of entities in the collection. Available when using the [$count](http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part1-protocol.html#_The_$inlinecount_System) query option." + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ODataDemo.PersonDetail" + } + } + } + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "post": { + "summary": "Add new entity to PersonDetails", + "tags": [ + "PersonDetails" + ], + "requestBody": { + "required": true, + "description": "New entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ODataDemo.PersonDetail-create" + } + } + } + }, + "responses": { + "201": { + "description": "Created entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ODataDemo.PersonDetail" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + } + }, + "/PersonDetails({PersonID})": { + "parameters": [ + { + "name": "PersonID", + "in": "path", + "required": true, + "description": "key: PersonID", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "get": { + "summary": "Get entity from PersonDetails by key", + "tags": [ + "PersonDetails" + ], + "parameters": [ + { + "name": "$select", + "in": "query", + "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)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "PersonID", + "Age", + "Gender", + "Phone", + "Address", + "Photo" + ] + } + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Person" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ODataDemo.PersonDetail" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "patch": { + "summary": "Update entity in PersonDetails", + "tags": [ + "PersonDetails" + ], + "requestBody": { + "required": true, + "description": "New property values", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ODataDemo.PersonDetail-update" + } + } + } + }, + "responses": { + "204": { + "description": "Success" + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "delete": { + "summary": "Delete entity from PersonDetails", + "tags": [ + "PersonDetails" + ], + "responses": { + "204": { + "description": "Success" + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + } + }, + "/PersonDetails({PersonID})/Person": { + "parameters": [ + { + "name": "PersonID", + "in": "path", + "required": true, + "description": "key: PersonID", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "get": { + "summary": "Get related Person", + "tags": [ + "PersonDetails", + "Persons" + ], + "parameters": [ + { + "name": "$select", + "in": "query", + "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)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Name" + ] + } + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "PersonDetail" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ODataDemo.Person" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + } + }, + "/Advertisements": { + "get": { + "summary": "Get entities from Advertisements", + "tags": [ + "Advertisements" + ], + "parameters": [ + { + "$ref": "#/components/parameters/top" + }, + { + "$ref": "#/components/parameters/skip" + }, + { + "name": "$filter", + "in": "query", + "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)", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/count" + }, + { + "name": "$orderby", + "in": "query", + "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)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "ID desc", + "Name", + "Name desc", + "AirDate", + "AirDate desc" + ] + } + } + }, + { + "name": "$select", + "in": "query", + "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)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Name", + "AirDate" + ] + } + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "FeaturedProduct" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved entities", + "content": { + "application/json": { + "schema": { + "title": "Collection of Advertisement", + "type": "object", + "properties": { + "@odata.count": { + "type": "number", + "description": "The count name/value pair represents the number of entities in the collection. Available when using the [$count](http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part1-protocol.html#_The_$inlinecount_System) query option." + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ODataDemo.Advertisement" + } + } + } + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "post": { + "summary": "Add new entity to Advertisements", + "tags": [ + "Advertisements" + ], + "requestBody": { + "required": true, + "description": "New entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ODataDemo.Advertisement-create" + } + } + } + }, + "responses": { + "201": { + "description": "Created entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ODataDemo.Advertisement" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + } + }, + "/Advertisements({ID})": { + "parameters": [ + { + "name": "ID", + "in": "path", + "required": true, + "description": "key: ID", + "schema": { + "type": "string", + "format": "uuid", + "example": "01234567-89ab-cdef-0123-456789abcdef" + } + } + ], + "get": { + "summary": "Get entity from Advertisements by key", + "tags": [ + "Advertisements" + ], + "parameters": [ + { + "name": "$select", + "in": "query", + "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)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Name", + "AirDate" + ] + } + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "FeaturedProduct" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ODataDemo.Advertisement" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "patch": { + "summary": "Update entity in Advertisements", + "tags": [ + "Advertisements" + ], + "requestBody": { + "required": true, + "description": "New property values", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ODataDemo.Advertisement-update" + } + } + } + }, + "responses": { + "204": { + "description": "Success" + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "delete": { + "summary": "Delete entity from Advertisements", + "tags": [ + "Advertisements" + ], + "responses": { + "204": { + "description": "Success" + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + } + }, + "/Advertisements({ID})/FeaturedProduct": { + "parameters": [ + { + "name": "ID", + "in": "path", + "required": true, + "description": "key: ID", + "schema": { + "type": "string", + "format": "uuid", + "example": "01234567-89ab-cdef-0123-456789abcdef" + } + } + ], + "get": { + "summary": "Get related FeaturedProduct", + "tags": [ + "Advertisements", + "Products" + ], + "parameters": [ + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Advertisement" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ODataDemo.FeaturedProduct" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + } + }, + "/GetProductsByRating(rating={rating})": { + "get": { + "summary": "Invoke function GetProductsByRating", + "tags": [ + "Products" + ], + "parameters": [ + { + "name": "rating", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int16" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "title": "Collection of Product", + "type": "object", + "properties": { + "@odata.count": { + "type": "number", + "description": "The count name/value pair represents the number of entities in the collection. Available when using the [$count](http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part1-protocol.html#_The_$inlinecount_System) query option." + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ODataDemo.Product" + } + } + } + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + } + }, + "/IncreaseSalaries": { + "post": { + "summary": "Invoke action IncreaseSalaries", + "tags": [ + "Service Operations" + ], + "requestBody": { + "description": "Action parameters", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "percentage": { + "type": "integer", + "format": "int32" + } + } + } + } + } + }, + "responses": { + "204": { + "description": "Success" + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + } + }, + "/$batch": { + "post": { + "summary": "Send 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 Products 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" + } + } + } + } + }, + "components": { + "schemas": { + "ODataDemo.Product": { + "type": "object", + "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, + "ID": { + "type": "integer", + "format": "int32" + }, + "Name": { + "type": "string", + "nullable": true + }, + "Description": { + "type": "string", + "nullable": true + }, + "ReleaseDate": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z" + }, + "DiscontinuedDate": { + "type": "string", + "nullable": true, + "format": "date-time", + "example": "2017-04-13T15:51:04Z" + }, + "Rating": { + "type": "integer", + "format": "int16" + }, + "Price": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "format": "double", + "example": 3.14 + }, + "Categories": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ODataDemo.Category" + } + }, + "Supplier": { + "nullable": true, + "anyOf": [ + { + "$ref": "#/components/schemas/ODataDemo.Supplier" + } + ] + }, + "ProductDetail": { + "nullable": true, + "anyOf": [ + { + "$ref": "#/components/schemas/ODataDemo.ProductDetail" + } + ] + } + }, + "anyOf": [ + { + "$ref": "#/components/schemas/ODataDemo.FeaturedProduct" + }, + { + + } + ], + "title": "Product" + }, + "ODataDemo.Product-create": { + "type": "object", + "properties": { + "ID": { + "type": "integer", + "format": "int32" + }, + "Name": { + "type": "string", + "nullable": true + }, + "Description": { + "type": "string", + "nullable": true + }, + "ReleaseDate": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z" + }, + "DiscontinuedDate": { + "type": "string", + "nullable": true, + "format": "date-time", + "example": "2017-04-13T15:51:04Z" + }, + "Rating": { + "type": "integer", + "format": "int16" + }, + "Price": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "format": "double", + "example": 3.14 + }, + "Categories": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ODataDemo.Category-create" + } + }, + "Supplier": { + "nullable": true, + "anyOf": [ + { + "$ref": "#/components/schemas/ODataDemo.Supplier-create" + } + ] + }, + "ProductDetail": { + "nullable": true, + "anyOf": [ + { + "$ref": "#/components/schemas/ODataDemo.ProductDetail-create" + } + ] + } + }, + "required": [ + "ID" + ], + "anyOf": [ + { + "$ref": "#/components/schemas/ODataDemo.FeaturedProduct-create" + }, + { + + } + ], + "title": "Product (for create)" + }, + "ODataDemo.Product-update": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": true + }, + "Description": { + "type": "string", + "nullable": true + }, + "ReleaseDate": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z" + }, + "DiscontinuedDate": { + "type": "string", + "nullable": true, + "format": "date-time", + "example": "2017-04-13T15:51:04Z" + }, + "Rating": { + "type": "integer", + "format": "int16" + }, + "Price": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "format": "double", + "example": 3.14 + } + }, + "anyOf": [ + { + "$ref": "#/components/schemas/ODataDemo.FeaturedProduct-update" + }, + { + + } + ], + "title": "Product (for update)" + }, + "ODataDemo.FeaturedProduct": { + "type": "object", + "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, + "ID": { + "type": "integer", + "format": "int32" + }, + "Name": { + "type": "string", + "nullable": true + }, + "Description": { + "type": "string", + "nullable": true + }, + "ReleaseDate": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z" + }, + "DiscontinuedDate": { + "type": "string", + "nullable": true, + "format": "date-time", + "example": "2017-04-13T15:51:04Z" + }, + "Rating": { + "type": "integer", + "format": "int16" + }, + "Price": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "format": "double", + "example": 3.14 + }, + "Categories": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ODataDemo.Category" + } + }, + "Supplier": { + "nullable": true, + "anyOf": [ + { + "$ref": "#/components/schemas/ODataDemo.Supplier" + } + ] + }, + "ProductDetail": { + "nullable": true, + "anyOf": [ + { + "$ref": "#/components/schemas/ODataDemo.ProductDetail" + } + ] + }, + "Advertisement": { + "nullable": true, + "anyOf": [ + { + "$ref": "#/components/schemas/ODataDemo.Advertisement" + } + ] + } + }, + "title": "FeaturedProduct" + }, + "ODataDemo.FeaturedProduct-create": { + "type": "object", + "properties": { + "ID": { + "type": "integer", + "format": "int32" + }, + "Name": { + "type": "string", + "nullable": true + }, + "Description": { + "type": "string", + "nullable": true + }, + "ReleaseDate": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z" + }, + "DiscontinuedDate": { + "type": "string", + "nullable": true, + "format": "date-time", + "example": "2017-04-13T15:51:04Z" + }, + "Rating": { + "type": "integer", + "format": "int16" + }, + "Price": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "format": "double", + "example": 3.14 + }, + "Categories": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ODataDemo.Category-create" + } + }, + "Supplier": { + "nullable": true, + "anyOf": [ + { + "$ref": "#/components/schemas/ODataDemo.Supplier-create" + } + ] + }, + "ProductDetail": { + "nullable": true, + "anyOf": [ + { + "$ref": "#/components/schemas/ODataDemo.ProductDetail-create" + } + ] + }, + "Advertisement": { + "nullable": true, + "anyOf": [ + { + "$ref": "#/components/schemas/ODataDemo.Advertisement-create" + } + ] + } + }, + "required": [ + "ID" + ], + "title": "FeaturedProduct (for create)" + }, + "ODataDemo.FeaturedProduct-update": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": true + }, + "Description": { + "type": "string", + "nullable": true + }, + "ReleaseDate": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z" + }, + "DiscontinuedDate": { + "type": "string", + "nullable": true, + "format": "date-time", + "example": "2017-04-13T15:51:04Z" + }, + "Rating": { + "type": "integer", + "format": "int16" + }, + "Price": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "format": "double", + "example": 3.14 + } + }, + "title": "FeaturedProduct (for update)" + }, + "ODataDemo.ProductDetail": { + "type": "object", + "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, + "ProductID": { + "type": "integer", + "format": "int32" + }, + "Details": { + "type": "string", + "nullable": true + }, + "Product": { + "nullable": true, + "anyOf": [ + { + "$ref": "#/components/schemas/ODataDemo.Product" + } + ] + } + }, + "title": "ProductDetail" + }, + "ODataDemo.ProductDetail-create": { + "type": "object", + "properties": { + "ProductID": { + "type": "integer", + "format": "int32" + }, + "Details": { + "type": "string", + "nullable": true + }, + "Product": { + "nullable": true, + "anyOf": [ + { + "$ref": "#/components/schemas/ODataDemo.Product-create" + } + ] + } + }, + "required": [ + "ProductID" + ], + "title": "ProductDetail (for create)" + }, + "ODataDemo.ProductDetail-update": { + "type": "object", + "properties": { + "Details": { + "type": "string", + "nullable": true + } + }, + "title": "ProductDetail (for update)" + }, + "ODataDemo.Category": { + "type": "object", + "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, + "ID": { + "type": "integer", + "format": "int32" + }, + "Name": { + "type": "string", + "nullable": true + }, + "Products": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ODataDemo.Product" + } + } + }, + "title": "Category" + }, + "ODataDemo.Category-create": { + "type": "object", + "properties": { + "ID": { + "type": "integer", + "format": "int32" + }, + "Name": { + "type": "string", + "nullable": true + }, + "Products": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ODataDemo.Product-create" + } + } + }, + "required": [ + "ID" + ], + "title": "Category (for create)" + }, + "ODataDemo.Category-update": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": true + } + }, + "title": "Category (for update)" + }, + "ODataDemo.Supplier": { + "type": "object", + "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, + "ID": { + "type": "integer", + "format": "int32" + }, + "Name": { + "type": "string", + "nullable": true + }, + "Address": { + "nullable": true, + "anyOf": [ + { + "$ref": "#/components/schemas/ODataDemo.Address" + } + ] + }, + "Location": { + "nullable": true, + "anyOf": [ + { + "$ref": "#/components/schemas/geoPoint" + } + ] + }, + "Concurrency": { + "type": "integer", + "format": "int32" + }, + "Products": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ODataDemo.Product" + } + } + }, + "title": "Supplier" + }, + "ODataDemo.Supplier-create": { + "type": "object", + "properties": { + "ID": { + "type": "integer", + "format": "int32" + }, + "Name": { + "type": "string", + "nullable": true + }, + "Address": { + "nullable": true, + "anyOf": [ + { + "$ref": "#/components/schemas/ODataDemo.Address-create" + } + ] + }, + "Location": { + "nullable": true, + "anyOf": [ + { + "$ref": "#/components/schemas/geoPoint" + } + ] + }, + "Concurrency": { + "type": "integer", + "format": "int32" + }, + "Products": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ODataDemo.Product-create" + } + } + }, + "required": [ + "ID" + ], + "title": "Supplier (for create)" + }, + "ODataDemo.Supplier-update": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": true + }, + "Address": { + "nullable": true, + "anyOf": [ + { + "$ref": "#/components/schemas/ODataDemo.Address-update" + } + ] + }, + "Location": { + "nullable": true, + "anyOf": [ + { + "$ref": "#/components/schemas/geoPoint" + } + ] + }, + "Concurrency": { + "type": "integer", + "format": "int32" + } + }, + "title": "Supplier (for update)" + }, + "ODataDemo.Address": { + "type": "object", + "properties": { + "Street": { + "type": "string", + "nullable": true + }, + "City": { + "type": "string", + "nullable": true + }, + "State": { + "type": "string", + "nullable": true + }, + "ZipCode": { + "type": "string", + "nullable": true + }, + "Country": { + "type": "string", + "nullable": true + } + }, + "title": "Address" + }, + "ODataDemo.Address-create": { + "type": "object", + "properties": { + "Street": { + "type": "string", + "nullable": true + }, + "City": { + "type": "string", + "nullable": true + }, + "State": { + "type": "string", + "nullable": true + }, + "ZipCode": { + "type": "string", + "nullable": true + }, + "Country": { + "type": "string", + "nullable": true + } + }, + "title": "Address (for create)" + }, + "ODataDemo.Address-update": { + "type": "object", + "properties": { + "Street": { + "type": "string", + "nullable": true + }, + "City": { + "type": "string", + "nullable": true + }, + "State": { + "type": "string", + "nullable": true + }, + "ZipCode": { + "type": "string", + "nullable": true + }, + "Country": { + "type": "string", + "nullable": true + } + }, + "title": "Address (for update)" + }, + "ODataDemo.Person": { + "type": "object", + "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, + "ID": { + "type": "integer", + "format": "int32" + }, + "Name": { + "type": "string", + "nullable": true + }, + "PersonDetail": { + "nullable": true, + "anyOf": [ + { + "$ref": "#/components/schemas/ODataDemo.PersonDetail" + } + ] + } + }, + "anyOf": [ + { + "$ref": "#/components/schemas/ODataDemo.Customer" + }, + { + "$ref": "#/components/schemas/ODataDemo.Employee" + }, + { + + } + ], + "title": "Person" + }, + "ODataDemo.Person-create": { + "type": "object", + "properties": { + "ID": { + "type": "integer", + "format": "int32" + }, + "Name": { + "type": "string", + "nullable": true + }, + "PersonDetail": { + "nullable": true, + "anyOf": [ + { + "$ref": "#/components/schemas/ODataDemo.PersonDetail-create" + } + ] + } + }, + "required": [ + "ID" + ], + "anyOf": [ + { + "$ref": "#/components/schemas/ODataDemo.Customer-create" + }, + { + "$ref": "#/components/schemas/ODataDemo.Employee-create" + }, + { + + } + ], + "title": "Person (for create)" + }, + "ODataDemo.Person-update": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": true + } + }, + "anyOf": [ + { + "$ref": "#/components/schemas/ODataDemo.Customer-update" + }, + { + "$ref": "#/components/schemas/ODataDemo.Employee-update" + }, + { + + } + ], + "title": "Person (for update)" + }, + "ODataDemo.Customer": { + "type": "object", + "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, + "ID": { + "type": "integer", + "format": "int32" + }, + "Name": { + "type": "string", + "nullable": true + }, + "PersonDetail": { + "nullable": true, + "anyOf": [ + { + "$ref": "#/components/schemas/ODataDemo.PersonDetail" + } + ] + }, + "TotalExpense": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "format": "decimal", + "multipleOf": 1, + "example": 0 + } + }, + "title": "Customer" + }, + "ODataDemo.Customer-create": { + "type": "object", + "properties": { + "ID": { + "type": "integer", + "format": "int32" + }, + "Name": { + "type": "string", + "nullable": true + }, + "PersonDetail": { + "nullable": true, + "anyOf": [ + { + "$ref": "#/components/schemas/ODataDemo.PersonDetail-create" + } + ] + }, + "TotalExpense": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "format": "decimal", + "multipleOf": 1, + "example": 0 + } + }, + "required": [ + "ID" + ], + "title": "Customer (for create)" + }, + "ODataDemo.Customer-update": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": true + }, + "TotalExpense": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "format": "decimal", + "multipleOf": 1, + "example": 0 + } + }, + "title": "Customer (for update)" + }, + "ODataDemo.Employee": { + "type": "object", + "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, + "ID": { + "type": "integer", + "format": "int32" + }, + "Name": { + "type": "string", + "nullable": true + }, + "PersonDetail": { + "nullable": true, + "anyOf": [ + { + "$ref": "#/components/schemas/ODataDemo.PersonDetail" + } + ] + }, + "EmployeeID": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string" + } + ], + "format": "int64", + "example": "42" + }, + "HireDate": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z" + }, + "Salary": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "format": "float", + "example": 3.14 + } + }, + "title": "Employee" + }, + "ODataDemo.Employee-create": { + "type": "object", + "properties": { + "ID": { + "type": "integer", + "format": "int32" + }, + "Name": { + "type": "string", + "nullable": true + }, + "PersonDetail": { + "nullable": true, + "anyOf": [ + { + "$ref": "#/components/schemas/ODataDemo.PersonDetail-create" + } + ] + }, + "EmployeeID": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string" + } + ], + "format": "int64", + "example": "42" + }, + "HireDate": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z" + }, + "Salary": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "format": "float", + "example": 3.14 + } + }, + "required": [ + "ID" + ], + "title": "Employee (for create)" + }, + "ODataDemo.Employee-update": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": true + }, + "EmployeeID": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string" + } + ], + "format": "int64", + "example": "42" + }, + "HireDate": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z" + }, + "Salary": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "format": "float", + "example": 3.14 + } + }, + "title": "Employee (for update)" + }, + "ODataDemo.PersonDetail": { + "type": "object", + "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, + "PersonID": { + "type": "integer", + "format": "int32" + }, + "Age": { + "type": "integer", + "format": "uint8" + }, + "Gender": { + "type": "boolean" + }, + "Phone": { + "type": "string", + "nullable": true + }, + "Address": { + "nullable": true, + "anyOf": [ + { + "$ref": "#/components/schemas/ODataDemo.Address" + } + ] + }, + "Photo": { + "type": "string", + "format": "base64url" + }, + "Person": { + "nullable": true, + "anyOf": [ + { + "$ref": "#/components/schemas/ODataDemo.Person" + } + ] + } + }, + "title": "PersonDetail" + }, + "ODataDemo.PersonDetail-create": { + "type": "object", + "properties": { + "PersonID": { + "type": "integer", + "format": "int32" + }, + "Age": { + "type": "integer", + "format": "uint8" + }, + "Gender": { + "type": "boolean" + }, + "Phone": { + "type": "string", + "nullable": true + }, + "Address": { + "nullable": true, + "anyOf": [ + { + "$ref": "#/components/schemas/ODataDemo.Address-create" + } + ] + }, + "Photo": { + "type": "string", + "format": "base64url" + }, + "Person": { + "nullable": true, + "anyOf": [ + { + "$ref": "#/components/schemas/ODataDemo.Person-create" + } + ] + } + }, + "required": [ + "PersonID" + ], + "title": "PersonDetail (for create)" + }, + "ODataDemo.PersonDetail-update": { + "type": "object", + "properties": { + "Age": { + "type": "integer", + "format": "uint8" + }, + "Gender": { + "type": "boolean" + }, + "Phone": { + "type": "string", + "nullable": true + }, + "Address": { + "nullable": true, + "anyOf": [ + { + "$ref": "#/components/schemas/ODataDemo.Address-update" + } + ] + }, + "Photo": { + "type": "string", + "format": "base64url" + } + }, + "title": "PersonDetail (for update)" + }, + "ODataDemo.Advertisement": { + "type": "object", + "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, + "ID": { + "type": "string", + "format": "uuid", + "example": "01234567-89ab-cdef-0123-456789abcdef" + }, + "Name": { + "type": "string", + "nullable": true + }, + "AirDate": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z" + }, + "FeaturedProduct": { + "nullable": true, + "anyOf": [ + { + "$ref": "#/components/schemas/ODataDemo.FeaturedProduct" + } + ] + } + }, + "title": "Advertisement" + }, + "ODataDemo.Advertisement-create": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "format": "uuid", + "example": "01234567-89ab-cdef-0123-456789abcdef" + }, + "Name": { + "type": "string", + "nullable": true + }, + "AirDate": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z" + }, + "FeaturedProduct": { + "nullable": true, + "anyOf": [ + { + "$ref": "#/components/schemas/ODataDemo.FeaturedProduct-create" + } + ] + } + }, + "required": [ + "ID" + ], + "title": "Advertisement (for create)" + }, + "ODataDemo.Advertisement-update": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": true + }, + "AirDate": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z" + } + }, + "title": "Advertisement (for update)" + }, + "geoPoint": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "Point" + ], + "default": "Point" + }, + "coordinates": { + "$ref": "#/components/schemas/geoPosition" + } + }, + "required": [ + "type", + "coordinates" + ] + }, + "geoPosition": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2 + }, + "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" + } + } + } + } + } + } +} diff --git a/tools/tests/odata-rw-v3.V4.swagger.json b/tools/tests/odata-rw-v3.V4.swagger.json new file mode 100644 index 00000000..9c5c0c9f --- /dev/null +++ b/tools/tests/odata-rw-v3.V4.swagger.json @@ -0,0 +1,3917 @@ +{ + "swagger": "2.0", + "info": { + "title": "Service for namespace ODataDemo", + "version": "", + "description": "This service is located at [https://localhost/service-root/](https://localhost/service-root/)\n\n## Entity Data Model\n![ER Diagram](https://yuml.me/diagram/class/[Product{bg:orange}],[Product]-*>[Category],[Product]-0..1>[Supplier],[Product]-0..1>[ProductDetail],[Product]^[FeaturedProduct{bg:orange}],[FeaturedProduct]-0..1>[Advertisement],[ProductDetail{bg:orange}],[ProductDetail]-0..1>[Product],[Category{bg:orange}],[Category]-*>[Product],[Supplier{bg:orange}],[Supplier]++-0..1[Address],[Supplier]-*>[Product],[Address],[Person{bg:orange}],[Person]-0..1>[PersonDetail],[Person]^[Customer{bg:orange}],[Person]^[Employee{bg:orange}],[PersonDetail{bg:orange}],[PersonDetail]++-0..1[Address],[PersonDetail]-0..1>[Person],[Advertisement{bg:orange}],[Advertisement]-0..1>[FeaturedProduct],[Products{bg:dodgerblue}]++-*>[Product],[ProductDetails{bg:dodgerblue}]++-*>[ProductDetail],[Categories{bg:dodgerblue}]++-*>[Category],[Suppliers{bg:dodgerblue}]++-*>[Supplier],[Persons{bg:dodgerblue}]++-*>[Person],[PersonDetails{bg:dodgerblue}]++-*>[PersonDetail],[Advertisements{bg:dodgerblue}]++-*>[Advertisement],[GetProductsByRating{bg:dodgerblue}]-*>[Product],[IncreaseSalaries{bg:dodgerblue}])\n\n### Legend\n![Legend](https://yuml.me/diagram/plain;dir:TB;scale:60/class/[External.Type{bg:whitesmoke}],[ComplexType],[EntityType{bg:orange}],[EntitySet/Singleton/Operation{bg:dodgerblue}])" + }, + "schemes": [ + "https" + ], + "host": "localhost", + "basePath": "/service-root", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + { + "name": "Products" + }, + { + "name": "ProductDetails" + }, + { + "name": "Categories" + }, + { + "name": "Suppliers" + }, + { + "name": "Persons" + }, + { + "name": "PersonDetails" + }, + { + "name": "Advertisements" + } + ], + "paths": { + "/Products": { + "get": { + "summary": "Get entities from Products", + "tags": [ + "Products" + ], + "parameters": [ + { + "$ref": "#/parameters/top" + }, + { + "$ref": "#/parameters/skip" + }, + { + "name": "$filter", + "in": "query", + "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)", + "type": "string" + }, + { + "$ref": "#/parameters/count" + }, + { + "name": "$orderby", + "in": "query", + "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)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "ID desc", + "Name", + "Name desc", + "Description", + "Description desc", + "ReleaseDate", + "ReleaseDate desc", + "DiscontinuedDate", + "DiscontinuedDate desc", + "Rating", + "Rating desc", + "Price", + "Price desc" + ] + } + }, + { + "name": "$select", + "in": "query", + "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)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Name", + "Description", + "ReleaseDate", + "DiscontinuedDate", + "Rating", + "Price" + ] + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Categories", + "Supplier", + "ProductDetail" + ] + } + } + ], + "responses": { + "200": { + "description": "Retrieved entities", + "schema": { + "title": "Collection of Product", + "type": "object", + "properties": { + "@odata.count": { + "type": "number", + "description": "The count name/value pair represents the number of entities in the collection. Available when using the [$count](http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part1-protocol.html#_The_$inlinecount_System) query option." + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/ODataDemo.Product" + } + } + } + } + }, + "400": { + "$ref": "#/responses/error" + } + } + }, + "post": { + "summary": "Add new entity to Products", + "tags": [ + "Products" + ], + "parameters": [ + { + "name": "Product", + "in": "body", + "description": "New entity", + "schema": { + "$ref": "#/definitions/ODataDemo.Product-create" + } + } + ], + "responses": { + "201": { + "description": "Created entity", + "schema": { + "$ref": "#/definitions/ODataDemo.Product" + } + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/Products({ID})": { + "parameters": [ + { + "name": "ID", + "in": "path", + "required": true, + "description": "key: ID", + "type": "integer", + "format": "int32" + } + ], + "get": { + "summary": "Get entity from Products by key", + "tags": [ + "Products" + ], + "parameters": [ + { + "name": "$select", + "in": "query", + "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)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Name", + "Description", + "ReleaseDate", + "DiscontinuedDate", + "Rating", + "Price" + ] + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Categories", + "Supplier", + "ProductDetail" + ] + } + } + ], + "responses": { + "200": { + "description": "Retrieved entity", + "schema": { + "$ref": "#/definitions/ODataDemo.Product" + } + }, + "400": { + "$ref": "#/responses/error" + } + } + }, + "patch": { + "summary": "Update entity in Products", + "tags": [ + "Products" + ], + "parameters": [ + { + "name": "Product", + "in": "body", + "description": "New property values", + "schema": { + "$ref": "#/definitions/ODataDemo.Product-update" + } + } + ], + "responses": { + "204": { + "description": "Success" + }, + "400": { + "$ref": "#/responses/error" + } + } + }, + "delete": { + "summary": "Delete entity from Products", + "tags": [ + "Products" + ], + "responses": { + "204": { + "description": "Success" + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/Products({ID})/ODataDemo.Discount": { + "post": { + "summary": "Invoke action Discount", + "tags": [ + "Products" + ], + "parameters": [ + { + "name": "ID", + "in": "path", + "required": true, + "description": "key: ID", + "type": "integer", + "format": "int32" + }, + { + "name": "body", + "in": "body", + "description": "Action parameters", + "schema": { + "type": "object", + "properties": { + "discountPercentage": { + "type": "integer", + "format": "int32" + } + } + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "type": [ + "number", + "string" + ], + "format": "double", + "example": 3.14 + } + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/Products({ID})/Categories": { + "parameters": [ + { + "name": "ID", + "in": "path", + "required": true, + "description": "key: ID", + "type": "integer", + "format": "int32" + } + ], + "get": { + "summary": "Get entities from related Categories", + "tags": [ + "Products", + "Categories" + ], + "parameters": [ + { + "$ref": "#/parameters/top" + }, + { + "$ref": "#/parameters/skip" + }, + { + "name": "$filter", + "in": "query", + "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)", + "type": "string" + }, + { + "$ref": "#/parameters/count" + }, + { + "name": "$orderby", + "in": "query", + "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)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "ID desc", + "Name", + "Name desc" + ] + } + }, + { + "name": "$select", + "in": "query", + "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)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Name" + ] + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Products" + ] + } + } + ], + "responses": { + "200": { + "description": "Retrieved entities", + "schema": { + "title": "Collection of Category", + "type": "object", + "properties": { + "@odata.count": { + "type": "number", + "description": "The count name/value pair represents the number of entities in the collection. Available when using the [$count](http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part1-protocol.html#_The_$inlinecount_System) query option." + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/ODataDemo.Category" + } + } + } + } + }, + "400": { + "$ref": "#/responses/error" + } + } + }, + "post": { + "summary": "Add new entity to related Categories", + "tags": [ + "Products", + "Categories" + ], + "parameters": [ + { + "name": "Category", + "in": "body", + "description": "New entity", + "schema": { + "$ref": "#/definitions/ODataDemo.Category-create" + } + } + ], + "responses": { + "201": { + "description": "Created entity", + "schema": { + "$ref": "#/definitions/ODataDemo.Category" + } + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/Products({ID})/Supplier": { + "parameters": [ + { + "name": "ID", + "in": "path", + "required": true, + "description": "key: ID", + "type": "integer", + "format": "int32" + } + ], + "get": { + "summary": "Get related Supplier", + "tags": [ + "Products", + "Suppliers" + ], + "parameters": [ + { + "name": "$select", + "in": "query", + "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)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Name", + "Address", + "Location", + "Concurrency" + ] + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Products" + ] + } + } + ], + "responses": { + "200": { + "description": "Retrieved entity", + "schema": { + "$ref": "#/definitions/ODataDemo.Supplier" + } + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/Products({ID})/ProductDetail": { + "parameters": [ + { + "name": "ID", + "in": "path", + "required": true, + "description": "key: ID", + "type": "integer", + "format": "int32" + } + ], + "get": { + "summary": "Get related ProductDetail", + "tags": [ + "Products", + "ProductDetails" + ], + "parameters": [ + { + "name": "$select", + "in": "query", + "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)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ProductID", + "Details" + ] + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Product" + ] + } + } + ], + "responses": { + "200": { + "description": "Retrieved entity", + "schema": { + "$ref": "#/definitions/ODataDemo.ProductDetail" + } + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/ProductDetails": { + "get": { + "summary": "Get entities from ProductDetails", + "tags": [ + "ProductDetails" + ], + "parameters": [ + { + "$ref": "#/parameters/top" + }, + { + "$ref": "#/parameters/skip" + }, + { + "name": "$filter", + "in": "query", + "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)", + "type": "string" + }, + { + "$ref": "#/parameters/count" + }, + { + "name": "$orderby", + "in": "query", + "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)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ProductID", + "ProductID desc", + "Details", + "Details desc" + ] + } + }, + { + "name": "$select", + "in": "query", + "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)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ProductID", + "Details" + ] + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Product" + ] + } + } + ], + "responses": { + "200": { + "description": "Retrieved entities", + "schema": { + "title": "Collection of ProductDetail", + "type": "object", + "properties": { + "@odata.count": { + "type": "number", + "description": "The count name/value pair represents the number of entities in the collection. Available when using the [$count](http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part1-protocol.html#_The_$inlinecount_System) query option." + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/ODataDemo.ProductDetail" + } + } + } + } + }, + "400": { + "$ref": "#/responses/error" + } + } + }, + "post": { + "summary": "Add new entity to ProductDetails", + "tags": [ + "ProductDetails" + ], + "parameters": [ + { + "name": "ProductDetail", + "in": "body", + "description": "New entity", + "schema": { + "$ref": "#/definitions/ODataDemo.ProductDetail-create" + } + } + ], + "responses": { + "201": { + "description": "Created entity", + "schema": { + "$ref": "#/definitions/ODataDemo.ProductDetail" + } + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/ProductDetails({ProductID})": { + "parameters": [ + { + "name": "ProductID", + "in": "path", + "required": true, + "description": "key: ProductID", + "type": "integer", + "format": "int32" + } + ], + "get": { + "summary": "Get entity from ProductDetails by key", + "tags": [ + "ProductDetails" + ], + "parameters": [ + { + "name": "$select", + "in": "query", + "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)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ProductID", + "Details" + ] + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Product" + ] + } + } + ], + "responses": { + "200": { + "description": "Retrieved entity", + "schema": { + "$ref": "#/definitions/ODataDemo.ProductDetail" + } + }, + "400": { + "$ref": "#/responses/error" + } + } + }, + "patch": { + "summary": "Update entity in ProductDetails", + "tags": [ + "ProductDetails" + ], + "parameters": [ + { + "name": "ProductDetail", + "in": "body", + "description": "New property values", + "schema": { + "$ref": "#/definitions/ODataDemo.ProductDetail-update" + } + } + ], + "responses": { + "204": { + "description": "Success" + }, + "400": { + "$ref": "#/responses/error" + } + } + }, + "delete": { + "summary": "Delete entity from ProductDetails", + "tags": [ + "ProductDetails" + ], + "responses": { + "204": { + "description": "Success" + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/ProductDetails({ProductID})/Product": { + "parameters": [ + { + "name": "ProductID", + "in": "path", + "required": true, + "description": "key: ProductID", + "type": "integer", + "format": "int32" + } + ], + "get": { + "summary": "Get related Product", + "tags": [ + "ProductDetails", + "Products" + ], + "parameters": [ + { + "name": "$select", + "in": "query", + "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)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Name", + "Description", + "ReleaseDate", + "DiscontinuedDate", + "Rating", + "Price" + ] + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Categories", + "Supplier", + "ProductDetail" + ] + } + } + ], + "responses": { + "200": { + "description": "Retrieved entity", + "schema": { + "$ref": "#/definitions/ODataDemo.Product" + } + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/ProductDetails({ProductID})/Product/ODataDemo.Discount": { + "post": { + "summary": "Invoke action Discount", + "tags": [ + "ProductDetails" + ], + "parameters": [ + { + "name": "ProductID", + "in": "path", + "required": true, + "description": "key: ProductID", + "type": "integer", + "format": "int32" + }, + { + "name": "body", + "in": "body", + "description": "Action parameters", + "schema": { + "type": "object", + "properties": { + "discountPercentage": { + "type": "integer", + "format": "int32" + } + } + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "type": [ + "number", + "string" + ], + "format": "double", + "example": 3.14 + } + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/Categories": { + "get": { + "summary": "Get entities from Categories", + "tags": [ + "Categories" + ], + "parameters": [ + { + "$ref": "#/parameters/top" + }, + { + "$ref": "#/parameters/skip" + }, + { + "name": "$filter", + "in": "query", + "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)", + "type": "string" + }, + { + "$ref": "#/parameters/count" + }, + { + "name": "$orderby", + "in": "query", + "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)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "ID desc", + "Name", + "Name desc" + ] + } + }, + { + "name": "$select", + "in": "query", + "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)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Name" + ] + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Products" + ] + } + } + ], + "responses": { + "200": { + "description": "Retrieved entities", + "schema": { + "title": "Collection of Category", + "type": "object", + "properties": { + "@odata.count": { + "type": "number", + "description": "The count name/value pair represents the number of entities in the collection. Available when using the [$count](http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part1-protocol.html#_The_$inlinecount_System) query option." + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/ODataDemo.Category" + } + } + } + } + }, + "400": { + "$ref": "#/responses/error" + } + } + }, + "post": { + "summary": "Add new entity to Categories", + "tags": [ + "Categories" + ], + "parameters": [ + { + "name": "Category", + "in": "body", + "description": "New entity", + "schema": { + "$ref": "#/definitions/ODataDemo.Category-create" + } + } + ], + "responses": { + "201": { + "description": "Created entity", + "schema": { + "$ref": "#/definitions/ODataDemo.Category" + } + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/Categories({ID})": { + "parameters": [ + { + "name": "ID", + "in": "path", + "required": true, + "description": "key: ID", + "type": "integer", + "format": "int32" + } + ], + "get": { + "summary": "Get entity from Categories by key", + "tags": [ + "Categories" + ], + "parameters": [ + { + "name": "$select", + "in": "query", + "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)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Name" + ] + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Products" + ] + } + } + ], + "responses": { + "200": { + "description": "Retrieved entity", + "schema": { + "$ref": "#/definitions/ODataDemo.Category" + } + }, + "400": { + "$ref": "#/responses/error" + } + } + }, + "patch": { + "summary": "Update entity in Categories", + "tags": [ + "Categories" + ], + "parameters": [ + { + "name": "Category", + "in": "body", + "description": "New property values", + "schema": { + "$ref": "#/definitions/ODataDemo.Category-update" + } + } + ], + "responses": { + "204": { + "description": "Success" + }, + "400": { + "$ref": "#/responses/error" + } + } + }, + "delete": { + "summary": "Delete entity from Categories", + "tags": [ + "Categories" + ], + "responses": { + "204": { + "description": "Success" + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/Categories({ID})/Products": { + "parameters": [ + { + "name": "ID", + "in": "path", + "required": true, + "description": "key: ID", + "type": "integer", + "format": "int32" + } + ], + "get": { + "summary": "Get entities from related Products", + "tags": [ + "Categories", + "Products" + ], + "parameters": [ + { + "$ref": "#/parameters/top" + }, + { + "$ref": "#/parameters/skip" + }, + { + "name": "$filter", + "in": "query", + "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)", + "type": "string" + }, + { + "$ref": "#/parameters/count" + }, + { + "name": "$orderby", + "in": "query", + "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)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "ID desc", + "Name", + "Name desc", + "Description", + "Description desc", + "ReleaseDate", + "ReleaseDate desc", + "DiscontinuedDate", + "DiscontinuedDate desc", + "Rating", + "Rating desc", + "Price", + "Price desc" + ] + } + }, + { + "name": "$select", + "in": "query", + "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)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Name", + "Description", + "ReleaseDate", + "DiscontinuedDate", + "Rating", + "Price" + ] + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Categories", + "Supplier", + "ProductDetail" + ] + } + } + ], + "responses": { + "200": { + "description": "Retrieved entities", + "schema": { + "title": "Collection of Product", + "type": "object", + "properties": { + "@odata.count": { + "type": "number", + "description": "The count name/value pair represents the number of entities in the collection. Available when using the [$count](http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part1-protocol.html#_The_$inlinecount_System) query option." + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/ODataDemo.Product" + } + } + } + } + }, + "400": { + "$ref": "#/responses/error" + } + } + }, + "post": { + "summary": "Add new entity to related Products", + "tags": [ + "Categories", + "Products" + ], + "parameters": [ + { + "name": "Product", + "in": "body", + "description": "New entity", + "schema": { + "$ref": "#/definitions/ODataDemo.Product-create" + } + } + ], + "responses": { + "201": { + "description": "Created entity", + "schema": { + "$ref": "#/definitions/ODataDemo.Product" + } + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/Suppliers": { + "get": { + "summary": "Get entities from Suppliers", + "tags": [ + "Suppliers" + ], + "parameters": [ + { + "$ref": "#/parameters/top" + }, + { + "$ref": "#/parameters/skip" + }, + { + "name": "$filter", + "in": "query", + "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)", + "type": "string" + }, + { + "$ref": "#/parameters/count" + }, + { + "name": "$orderby", + "in": "query", + "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)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "ID desc", + "Name", + "Name desc", + "Address", + "Address desc", + "Location", + "Location desc", + "Concurrency", + "Concurrency desc" + ] + } + }, + { + "name": "$select", + "in": "query", + "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)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Name", + "Address", + "Location", + "Concurrency" + ] + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Products" + ] + } + } + ], + "responses": { + "200": { + "description": "Retrieved entities", + "schema": { + "title": "Collection of Supplier", + "type": "object", + "properties": { + "@odata.count": { + "type": "number", + "description": "The count name/value pair represents the number of entities in the collection. Available when using the [$count](http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part1-protocol.html#_The_$inlinecount_System) query option." + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/ODataDemo.Supplier" + } + } + } + } + }, + "400": { + "$ref": "#/responses/error" + } + } + }, + "post": { + "summary": "Add new entity to Suppliers", + "tags": [ + "Suppliers" + ], + "parameters": [ + { + "name": "Supplier", + "in": "body", + "description": "New entity", + "schema": { + "$ref": "#/definitions/ODataDemo.Supplier-create" + } + } + ], + "responses": { + "201": { + "description": "Created entity", + "schema": { + "$ref": "#/definitions/ODataDemo.Supplier" + } + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/Suppliers({ID})": { + "parameters": [ + { + "name": "ID", + "in": "path", + "required": true, + "description": "key: ID", + "type": "integer", + "format": "int32" + } + ], + "get": { + "summary": "Get entity from Suppliers by key", + "tags": [ + "Suppliers" + ], + "parameters": [ + { + "name": "$select", + "in": "query", + "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)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Name", + "Address", + "Location", + "Concurrency" + ] + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Products" + ] + } + } + ], + "responses": { + "200": { + "description": "Retrieved entity", + "schema": { + "$ref": "#/definitions/ODataDemo.Supplier" + } + }, + "400": { + "$ref": "#/responses/error" + } + } + }, + "patch": { + "summary": "Update entity in Suppliers", + "tags": [ + "Suppliers" + ], + "parameters": [ + { + "name": "Supplier", + "in": "body", + "description": "New property values", + "schema": { + "$ref": "#/definitions/ODataDemo.Supplier-update" + } + } + ], + "responses": { + "204": { + "description": "Success" + }, + "400": { + "$ref": "#/responses/error" + } + } + }, + "delete": { + "summary": "Delete entity from Suppliers", + "tags": [ + "Suppliers" + ], + "responses": { + "204": { + "description": "Success" + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/Suppliers({ID})/Products": { + "parameters": [ + { + "name": "ID", + "in": "path", + "required": true, + "description": "key: ID", + "type": "integer", + "format": "int32" + } + ], + "get": { + "summary": "Get entities from related Products", + "tags": [ + "Suppliers", + "Products" + ], + "parameters": [ + { + "$ref": "#/parameters/top" + }, + { + "$ref": "#/parameters/skip" + }, + { + "name": "$filter", + "in": "query", + "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)", + "type": "string" + }, + { + "$ref": "#/parameters/count" + }, + { + "name": "$orderby", + "in": "query", + "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)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "ID desc", + "Name", + "Name desc", + "Description", + "Description desc", + "ReleaseDate", + "ReleaseDate desc", + "DiscontinuedDate", + "DiscontinuedDate desc", + "Rating", + "Rating desc", + "Price", + "Price desc" + ] + } + }, + { + "name": "$select", + "in": "query", + "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)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Name", + "Description", + "ReleaseDate", + "DiscontinuedDate", + "Rating", + "Price" + ] + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Categories", + "Supplier", + "ProductDetail" + ] + } + } + ], + "responses": { + "200": { + "description": "Retrieved entities", + "schema": { + "title": "Collection of Product", + "type": "object", + "properties": { + "@odata.count": { + "type": "number", + "description": "The count name/value pair represents the number of entities in the collection. Available when using the [$count](http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part1-protocol.html#_The_$inlinecount_System) query option." + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/ODataDemo.Product" + } + } + } + } + }, + "400": { + "$ref": "#/responses/error" + } + } + }, + "post": { + "summary": "Add new entity to related Products", + "tags": [ + "Suppliers", + "Products" + ], + "parameters": [ + { + "name": "Product", + "in": "body", + "description": "New entity", + "schema": { + "$ref": "#/definitions/ODataDemo.Product-create" + } + } + ], + "responses": { + "201": { + "description": "Created entity", + "schema": { + "$ref": "#/definitions/ODataDemo.Product" + } + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/Persons": { + "get": { + "summary": "Get entities from Persons", + "tags": [ + "Persons" + ], + "parameters": [ + { + "$ref": "#/parameters/top" + }, + { + "$ref": "#/parameters/skip" + }, + { + "name": "$filter", + "in": "query", + "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)", + "type": "string" + }, + { + "$ref": "#/parameters/count" + }, + { + "name": "$orderby", + "in": "query", + "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)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "ID desc", + "Name", + "Name desc" + ] + } + }, + { + "name": "$select", + "in": "query", + "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)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Name" + ] + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "PersonDetail" + ] + } + } + ], + "responses": { + "200": { + "description": "Retrieved entities", + "schema": { + "title": "Collection of Person", + "type": "object", + "properties": { + "@odata.count": { + "type": "number", + "description": "The count name/value pair represents the number of entities in the collection. Available when using the [$count](http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part1-protocol.html#_The_$inlinecount_System) query option." + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/ODataDemo.Person" + } + } + } + } + }, + "400": { + "$ref": "#/responses/error" + } + } + }, + "post": { + "summary": "Add new entity to Persons", + "tags": [ + "Persons" + ], + "parameters": [ + { + "name": "Person", + "in": "body", + "description": "New entity", + "schema": { + "$ref": "#/definitions/ODataDemo.Person-create" + } + } + ], + "responses": { + "201": { + "description": "Created entity", + "schema": { + "$ref": "#/definitions/ODataDemo.Person" + } + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/Persons({ID})": { + "parameters": [ + { + "name": "ID", + "in": "path", + "required": true, + "description": "key: ID", + "type": "integer", + "format": "int32" + } + ], + "get": { + "summary": "Get entity from Persons by key", + "tags": [ + "Persons" + ], + "parameters": [ + { + "name": "$select", + "in": "query", + "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)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Name" + ] + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "PersonDetail" + ] + } + } + ], + "responses": { + "200": { + "description": "Retrieved entity", + "schema": { + "$ref": "#/definitions/ODataDemo.Person" + } + }, + "400": { + "$ref": "#/responses/error" + } + } + }, + "patch": { + "summary": "Update entity in Persons", + "tags": [ + "Persons" + ], + "parameters": [ + { + "name": "Person", + "in": "body", + "description": "New property values", + "schema": { + "$ref": "#/definitions/ODataDemo.Person-update" + } + } + ], + "responses": { + "204": { + "description": "Success" + }, + "400": { + "$ref": "#/responses/error" + } + } + }, + "delete": { + "summary": "Delete entity from Persons", + "tags": [ + "Persons" + ], + "responses": { + "204": { + "description": "Success" + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/Persons({ID})/PersonDetail": { + "parameters": [ + { + "name": "ID", + "in": "path", + "required": true, + "description": "key: ID", + "type": "integer", + "format": "int32" + } + ], + "get": { + "summary": "Get related PersonDetail", + "tags": [ + "Persons", + "PersonDetails" + ], + "parameters": [ + { + "name": "$select", + "in": "query", + "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)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "PersonID", + "Age", + "Gender", + "Phone", + "Address", + "Photo" + ] + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Person" + ] + } + } + ], + "responses": { + "200": { + "description": "Retrieved entity", + "schema": { + "$ref": "#/definitions/ODataDemo.PersonDetail" + } + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/PersonDetails": { + "get": { + "summary": "Get entities from PersonDetails", + "tags": [ + "PersonDetails" + ], + "parameters": [ + { + "$ref": "#/parameters/top" + }, + { + "$ref": "#/parameters/skip" + }, + { + "name": "$filter", + "in": "query", + "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)", + "type": "string" + }, + { + "$ref": "#/parameters/count" + }, + { + "name": "$orderby", + "in": "query", + "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)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "PersonID", + "PersonID desc", + "Age", + "Age desc", + "Gender", + "Gender desc", + "Phone", + "Phone desc", + "Address", + "Address desc", + "Photo", + "Photo desc" + ] + } + }, + { + "name": "$select", + "in": "query", + "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)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "PersonID", + "Age", + "Gender", + "Phone", + "Address", + "Photo" + ] + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Person" + ] + } + } + ], + "responses": { + "200": { + "description": "Retrieved entities", + "schema": { + "title": "Collection of PersonDetail", + "type": "object", + "properties": { + "@odata.count": { + "type": "number", + "description": "The count name/value pair represents the number of entities in the collection. Available when using the [$count](http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part1-protocol.html#_The_$inlinecount_System) query option." + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/ODataDemo.PersonDetail" + } + } + } + } + }, + "400": { + "$ref": "#/responses/error" + } + } + }, + "post": { + "summary": "Add new entity to PersonDetails", + "tags": [ + "PersonDetails" + ], + "parameters": [ + { + "name": "PersonDetail", + "in": "body", + "description": "New entity", + "schema": { + "$ref": "#/definitions/ODataDemo.PersonDetail-create" + } + } + ], + "responses": { + "201": { + "description": "Created entity", + "schema": { + "$ref": "#/definitions/ODataDemo.PersonDetail" + } + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/PersonDetails({PersonID})": { + "parameters": [ + { + "name": "PersonID", + "in": "path", + "required": true, + "description": "key: PersonID", + "type": "integer", + "format": "int32" + } + ], + "get": { + "summary": "Get entity from PersonDetails by key", + "tags": [ + "PersonDetails" + ], + "parameters": [ + { + "name": "$select", + "in": "query", + "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)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "PersonID", + "Age", + "Gender", + "Phone", + "Address", + "Photo" + ] + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Person" + ] + } + } + ], + "responses": { + "200": { + "description": "Retrieved entity", + "schema": { + "$ref": "#/definitions/ODataDemo.PersonDetail" + } + }, + "400": { + "$ref": "#/responses/error" + } + } + }, + "patch": { + "summary": "Update entity in PersonDetails", + "tags": [ + "PersonDetails" + ], + "parameters": [ + { + "name": "PersonDetail", + "in": "body", + "description": "New property values", + "schema": { + "$ref": "#/definitions/ODataDemo.PersonDetail-update" + } + } + ], + "responses": { + "204": { + "description": "Success" + }, + "400": { + "$ref": "#/responses/error" + } + } + }, + "delete": { + "summary": "Delete entity from PersonDetails", + "tags": [ + "PersonDetails" + ], + "responses": { + "204": { + "description": "Success" + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/PersonDetails({PersonID})/Person": { + "parameters": [ + { + "name": "PersonID", + "in": "path", + "required": true, + "description": "key: PersonID", + "type": "integer", + "format": "int32" + } + ], + "get": { + "summary": "Get related Person", + "tags": [ + "PersonDetails", + "Persons" + ], + "parameters": [ + { + "name": "$select", + "in": "query", + "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)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Name" + ] + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "PersonDetail" + ] + } + } + ], + "responses": { + "200": { + "description": "Retrieved entity", + "schema": { + "$ref": "#/definitions/ODataDemo.Person" + } + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/Advertisements": { + "get": { + "summary": "Get entities from Advertisements", + "tags": [ + "Advertisements" + ], + "parameters": [ + { + "$ref": "#/parameters/top" + }, + { + "$ref": "#/parameters/skip" + }, + { + "name": "$filter", + "in": "query", + "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)", + "type": "string" + }, + { + "$ref": "#/parameters/count" + }, + { + "name": "$orderby", + "in": "query", + "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)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "ID desc", + "Name", + "Name desc", + "AirDate", + "AirDate desc" + ] + } + }, + { + "name": "$select", + "in": "query", + "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)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Name", + "AirDate" + ] + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "FeaturedProduct" + ] + } + } + ], + "responses": { + "200": { + "description": "Retrieved entities", + "schema": { + "title": "Collection of Advertisement", + "type": "object", + "properties": { + "@odata.count": { + "type": "number", + "description": "The count name/value pair represents the number of entities in the collection. Available when using the [$count](http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part1-protocol.html#_The_$inlinecount_System) query option." + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/ODataDemo.Advertisement" + } + } + } + } + }, + "400": { + "$ref": "#/responses/error" + } + } + }, + "post": { + "summary": "Add new entity to Advertisements", + "tags": [ + "Advertisements" + ], + "parameters": [ + { + "name": "Advertisement", + "in": "body", + "description": "New entity", + "schema": { + "$ref": "#/definitions/ODataDemo.Advertisement-create" + } + } + ], + "responses": { + "201": { + "description": "Created entity", + "schema": { + "$ref": "#/definitions/ODataDemo.Advertisement" + } + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/Advertisements({ID})": { + "parameters": [ + { + "name": "ID", + "in": "path", + "required": true, + "description": "key: ID", + "type": "string" + } + ], + "get": { + "summary": "Get entity from Advertisements by key", + "tags": [ + "Advertisements" + ], + "parameters": [ + { + "name": "$select", + "in": "query", + "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)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Name", + "AirDate" + ] + } + }, + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "FeaturedProduct" + ] + } + } + ], + "responses": { + "200": { + "description": "Retrieved entity", + "schema": { + "$ref": "#/definitions/ODataDemo.Advertisement" + } + }, + "400": { + "$ref": "#/responses/error" + } + } + }, + "patch": { + "summary": "Update entity in Advertisements", + "tags": [ + "Advertisements" + ], + "parameters": [ + { + "name": "Advertisement", + "in": "body", + "description": "New property values", + "schema": { + "$ref": "#/definitions/ODataDemo.Advertisement-update" + } + } + ], + "responses": { + "204": { + "description": "Success" + }, + "400": { + "$ref": "#/responses/error" + } + } + }, + "delete": { + "summary": "Delete entity from Advertisements", + "tags": [ + "Advertisements" + ], + "responses": { + "204": { + "description": "Success" + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/Advertisements({ID})/FeaturedProduct": { + "parameters": [ + { + "name": "ID", + "in": "path", + "required": true, + "description": "key: ID", + "type": "string" + } + ], + "get": { + "summary": "Get related FeaturedProduct", + "tags": [ + "Advertisements", + "Products" + ], + "parameters": [ + { + "name": "$expand", + "in": "query", + "description": "Expand related entities, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Advertisement" + ] + } + } + ], + "responses": { + "200": { + "description": "Retrieved entity", + "schema": { + "$ref": "#/definitions/ODataDemo.FeaturedProduct" + } + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/GetProductsByRating(rating={rating})": { + "get": { + "summary": "Invoke function GetProductsByRating", + "tags": [ + "Products" + ], + "parameters": [ + { + "name": "rating", + "in": "path", + "required": true, + "type": "integer", + "format": "int16" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "title": "Collection of Product", + "type": "object", + "properties": { + "@odata.count": { + "type": "number", + "description": "The count name/value pair represents the number of entities in the collection. Available when using the [$count](http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part1-protocol.html#_The_$inlinecount_System) query option." + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/ODataDemo.Product" + } + } + } + } + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/IncreaseSalaries": { + "post": { + "summary": "Invoke action IncreaseSalaries", + "tags": [ + "Service Operations" + ], + "parameters": [ + { + "name": "body", + "in": "body", + "description": "Action parameters", + "schema": { + "type": "object", + "properties": { + "percentage": { + "type": "integer", + "format": "int32" + } + } + } + } + ], + "responses": { + "204": { + "description": "Success" + }, + "400": { + "$ref": "#/responses/error" + } + } + } + }, + "/$batch": { + "post": { + "summary": "Send 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).", + "tags": [ + "Batch Requests" + ], + "consumes": [ + "multipart/mixed;boundary=request-separator" + ], + "produces": [ + "multipart/mixed" + ], + "parameters": [ + { + "name": "requestBody", + "in": "body", + "description": "Batch request", + "schema": { + "type": "string", + "example": "--request-separator\nContent-Type: application/http\nContent-Transfer-Encoding: binary\n\nGET Products HTTP/1.1\nAccept: application/json\n\n\n--request-separator--" + } + } + ], + "responses": { + "200": { + "description": "Batch response", + "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--" + } + }, + "400": { + "$ref": "#/responses/error" + } + } + } + } + }, + "definitions": { + "ODataDemo.Product": { + "type": "object", + "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, + "ID": { + "type": "integer", + "format": "int32" + }, + "Name": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "Description": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "ReleaseDate": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z" + }, + "DiscontinuedDate": { + "type": [ + "string", + "null" + ], + "format": "date-time", + "example": "2017-04-13T15:51:04Z" + }, + "Rating": { + "type": "integer", + "format": "int16" + }, + "Price": { + "type": [ + "number", + "string" + ], + "format": "double", + "example": 3.14 + }, + "Categories": { + "type": "array", + "items": { + "$ref": "#/definitions/ODataDemo.Category" + } + }, + "Supplier": { + "$ref": "#/definitions/ODataDemo.Supplier" + }, + "ProductDetail": { + "$ref": "#/definitions/ODataDemo.ProductDetail" + } + }, + "title": "Product" + }, + "ODataDemo.Product-create": { + "type": "object", + "properties": { + "ID": { + "type": "integer", + "format": "int32" + }, + "Name": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "Description": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "ReleaseDate": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z" + }, + "DiscontinuedDate": { + "type": [ + "string", + "null" + ], + "format": "date-time", + "example": "2017-04-13T15:51:04Z" + }, + "Rating": { + "type": "integer", + "format": "int16" + }, + "Price": { + "type": [ + "number", + "string" + ], + "format": "double", + "example": 3.14 + }, + "Categories": { + "type": "array", + "items": { + "$ref": "#/definitions/ODataDemo.Category-create" + } + }, + "Supplier": { + "$ref": "#/definitions/ODataDemo.Supplier-create" + }, + "ProductDetail": { + "$ref": "#/definitions/ODataDemo.ProductDetail-create" + } + }, + "required": [ + "ID" + ], + "title": "Product (for create)" + }, + "ODataDemo.Product-update": { + "type": "object", + "properties": { + "Name": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "Description": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "ReleaseDate": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z" + }, + "DiscontinuedDate": { + "type": [ + "string", + "null" + ], + "format": "date-time", + "example": "2017-04-13T15:51:04Z" + }, + "Rating": { + "type": "integer", + "format": "int16" + }, + "Price": { + "type": [ + "number", + "string" + ], + "format": "double", + "example": 3.14 + } + }, + "title": "Product (for update)" + }, + "ODataDemo.FeaturedProduct": { + "type": "object", + "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, + "ID": { + "type": "integer", + "format": "int32" + }, + "Name": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "Description": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "ReleaseDate": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z" + }, + "DiscontinuedDate": { + "type": [ + "string", + "null" + ], + "format": "date-time", + "example": "2017-04-13T15:51:04Z" + }, + "Rating": { + "type": "integer", + "format": "int16" + }, + "Price": { + "type": [ + "number", + "string" + ], + "format": "double", + "example": 3.14 + }, + "Categories": { + "type": "array", + "items": { + "$ref": "#/definitions/ODataDemo.Category" + } + }, + "Supplier": { + "$ref": "#/definitions/ODataDemo.Supplier" + }, + "ProductDetail": { + "$ref": "#/definitions/ODataDemo.ProductDetail" + }, + "Advertisement": { + "$ref": "#/definitions/ODataDemo.Advertisement" + } + }, + "title": "FeaturedProduct" + }, + "ODataDemo.FeaturedProduct-create": { + "type": "object", + "properties": { + "ID": { + "type": "integer", + "format": "int32" + }, + "Name": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "Description": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "ReleaseDate": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z" + }, + "DiscontinuedDate": { + "type": [ + "string", + "null" + ], + "format": "date-time", + "example": "2017-04-13T15:51:04Z" + }, + "Rating": { + "type": "integer", + "format": "int16" + }, + "Price": { + "type": [ + "number", + "string" + ], + "format": "double", + "example": 3.14 + }, + "Categories": { + "type": "array", + "items": { + "$ref": "#/definitions/ODataDemo.Category-create" + } + }, + "Supplier": { + "$ref": "#/definitions/ODataDemo.Supplier-create" + }, + "ProductDetail": { + "$ref": "#/definitions/ODataDemo.ProductDetail-create" + }, + "Advertisement": { + "$ref": "#/definitions/ODataDemo.Advertisement-create" + } + }, + "required": [ + "ID" + ], + "title": "FeaturedProduct (for create)" + }, + "ODataDemo.FeaturedProduct-update": { + "type": "object", + "properties": { + "Name": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "Description": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "ReleaseDate": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z" + }, + "DiscontinuedDate": { + "type": [ + "string", + "null" + ], + "format": "date-time", + "example": "2017-04-13T15:51:04Z" + }, + "Rating": { + "type": "integer", + "format": "int16" + }, + "Price": { + "type": [ + "number", + "string" + ], + "format": "double", + "example": 3.14 + } + }, + "title": "FeaturedProduct (for update)" + }, + "ODataDemo.ProductDetail": { + "type": "object", + "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, + "ProductID": { + "type": "integer", + "format": "int32" + }, + "Details": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "Product": { + "$ref": "#/definitions/ODataDemo.Product" + } + }, + "title": "ProductDetail" + }, + "ODataDemo.ProductDetail-create": { + "type": "object", + "properties": { + "ProductID": { + "type": "integer", + "format": "int32" + }, + "Details": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "Product": { + "$ref": "#/definitions/ODataDemo.Product-create" + } + }, + "required": [ + "ProductID" + ], + "title": "ProductDetail (for create)" + }, + "ODataDemo.ProductDetail-update": { + "type": "object", + "properties": { + "Details": { + "type": [ + "string", + "null" + ], + "example": "string" + } + }, + "title": "ProductDetail (for update)" + }, + "ODataDemo.Category": { + "type": "object", + "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, + "ID": { + "type": "integer", + "format": "int32" + }, + "Name": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "Products": { + "type": "array", + "items": { + "$ref": "#/definitions/ODataDemo.Product" + } + } + }, + "title": "Category" + }, + "ODataDemo.Category-create": { + "type": "object", + "properties": { + "ID": { + "type": "integer", + "format": "int32" + }, + "Name": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "Products": { + "type": "array", + "items": { + "$ref": "#/definitions/ODataDemo.Product-create" + } + } + }, + "required": [ + "ID" + ], + "title": "Category (for create)" + }, + "ODataDemo.Category-update": { + "type": "object", + "properties": { + "Name": { + "type": [ + "string", + "null" + ], + "example": "string" + } + }, + "title": "Category (for update)" + }, + "ODataDemo.Supplier": { + "type": "object", + "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, + "ID": { + "type": "integer", + "format": "int32" + }, + "Name": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "Address": { + "$ref": "#/definitions/ODataDemo.Address" + }, + "Location": { + "$ref": "#/definitions/geoPoint" + }, + "Concurrency": { + "type": "integer", + "format": "int32" + }, + "Products": { + "type": "array", + "items": { + "$ref": "#/definitions/ODataDemo.Product" + } + } + }, + "title": "Supplier" + }, + "ODataDemo.Supplier-create": { + "type": "object", + "properties": { + "ID": { + "type": "integer", + "format": "int32" + }, + "Name": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "Address": { + "$ref": "#/definitions/ODataDemo.Address-create" + }, + "Location": { + "$ref": "#/definitions/geoPoint" + }, + "Concurrency": { + "type": "integer", + "format": "int32" + }, + "Products": { + "type": "array", + "items": { + "$ref": "#/definitions/ODataDemo.Product-create" + } + } + }, + "required": [ + "ID" + ], + "title": "Supplier (for create)" + }, + "ODataDemo.Supplier-update": { + "type": "object", + "properties": { + "Name": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "Address": { + "$ref": "#/definitions/ODataDemo.Address-update" + }, + "Location": { + "$ref": "#/definitions/geoPoint" + }, + "Concurrency": { + "type": "integer", + "format": "int32" + } + }, + "title": "Supplier (for update)" + }, + "ODataDemo.Address": { + "type": "object", + "properties": { + "Street": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "City": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "State": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "ZipCode": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "Country": { + "type": [ + "string", + "null" + ], + "example": "string" + } + }, + "title": "Address" + }, + "ODataDemo.Address-create": { + "type": "object", + "properties": { + "Street": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "City": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "State": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "ZipCode": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "Country": { + "type": [ + "string", + "null" + ], + "example": "string" + } + }, + "title": "Address (for create)" + }, + "ODataDemo.Address-update": { + "type": "object", + "properties": { + "Street": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "City": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "State": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "ZipCode": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "Country": { + "type": [ + "string", + "null" + ], + "example": "string" + } + }, + "title": "Address (for update)" + }, + "ODataDemo.Person": { + "type": "object", + "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, + "ID": { + "type": "integer", + "format": "int32" + }, + "Name": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "PersonDetail": { + "$ref": "#/definitions/ODataDemo.PersonDetail" + } + }, + "title": "Person" + }, + "ODataDemo.Person-create": { + "type": "object", + "properties": { + "ID": { + "type": "integer", + "format": "int32" + }, + "Name": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "PersonDetail": { + "$ref": "#/definitions/ODataDemo.PersonDetail-create" + } + }, + "required": [ + "ID" + ], + "title": "Person (for create)" + }, + "ODataDemo.Person-update": { + "type": "object", + "properties": { + "Name": { + "type": [ + "string", + "null" + ], + "example": "string" + } + }, + "title": "Person (for update)" + }, + "ODataDemo.Customer": { + "type": "object", + "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, + "ID": { + "type": "integer", + "format": "int32" + }, + "Name": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "PersonDetail": { + "$ref": "#/definitions/ODataDemo.PersonDetail" + }, + "TotalExpense": { + "type": [ + "number", + "string" + ], + "format": "decimal", + "multipleOf": 1, + "example": 0 + } + }, + "title": "Customer" + }, + "ODataDemo.Customer-create": { + "type": "object", + "properties": { + "ID": { + "type": "integer", + "format": "int32" + }, + "Name": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "PersonDetail": { + "$ref": "#/definitions/ODataDemo.PersonDetail-create" + }, + "TotalExpense": { + "type": [ + "number", + "string" + ], + "format": "decimal", + "multipleOf": 1, + "example": 0 + } + }, + "required": [ + "ID" + ], + "title": "Customer (for create)" + }, + "ODataDemo.Customer-update": { + "type": "object", + "properties": { + "Name": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "TotalExpense": { + "type": [ + "number", + "string" + ], + "format": "decimal", + "multipleOf": 1, + "example": 0 + } + }, + "title": "Customer (for update)" + }, + "ODataDemo.Employee": { + "type": "object", + "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, + "ID": { + "type": "integer", + "format": "int32" + }, + "Name": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "PersonDetail": { + "$ref": "#/definitions/ODataDemo.PersonDetail" + }, + "EmployeeID": { + "type": [ + "integer", + "string" + ], + "format": "int64", + "example": "42" + }, + "HireDate": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z" + }, + "Salary": { + "type": [ + "number", + "string" + ], + "format": "float", + "example": 3.14 + } + }, + "title": "Employee" + }, + "ODataDemo.Employee-create": { + "type": "object", + "properties": { + "ID": { + "type": "integer", + "format": "int32" + }, + "Name": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "PersonDetail": { + "$ref": "#/definitions/ODataDemo.PersonDetail-create" + }, + "EmployeeID": { + "type": [ + "integer", + "string" + ], + "format": "int64", + "example": "42" + }, + "HireDate": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z" + }, + "Salary": { + "type": [ + "number", + "string" + ], + "format": "float", + "example": 3.14 + } + }, + "required": [ + "ID" + ], + "title": "Employee (for create)" + }, + "ODataDemo.Employee-update": { + "type": "object", + "properties": { + "Name": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "EmployeeID": { + "type": [ + "integer", + "string" + ], + "format": "int64", + "example": "42" + }, + "HireDate": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z" + }, + "Salary": { + "type": [ + "number", + "string" + ], + "format": "float", + "example": 3.14 + } + }, + "title": "Employee (for update)" + }, + "ODataDemo.PersonDetail": { + "type": "object", + "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, + "PersonID": { + "type": "integer", + "format": "int32" + }, + "Age": { + "type": "integer", + "format": "uint8" + }, + "Gender": { + "type": "boolean" + }, + "Phone": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "Address": { + "$ref": "#/definitions/ODataDemo.Address" + }, + "Photo": { + "type": "string", + "format": "base64url" + }, + "Person": { + "$ref": "#/definitions/ODataDemo.Person" + } + }, + "title": "PersonDetail" + }, + "ODataDemo.PersonDetail-create": { + "type": "object", + "properties": { + "PersonID": { + "type": "integer", + "format": "int32" + }, + "Age": { + "type": "integer", + "format": "uint8" + }, + "Gender": { + "type": "boolean" + }, + "Phone": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "Address": { + "$ref": "#/definitions/ODataDemo.Address-create" + }, + "Photo": { + "type": "string", + "format": "base64url" + }, + "Person": { + "$ref": "#/definitions/ODataDemo.Person-create" + } + }, + "required": [ + "PersonID" + ], + "title": "PersonDetail (for create)" + }, + "ODataDemo.PersonDetail-update": { + "type": "object", + "properties": { + "Age": { + "type": "integer", + "format": "uint8" + }, + "Gender": { + "type": "boolean" + }, + "Phone": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "Address": { + "$ref": "#/definitions/ODataDemo.Address-update" + }, + "Photo": { + "type": "string", + "format": "base64url" + } + }, + "title": "PersonDetail (for update)" + }, + "ODataDemo.Advertisement": { + "type": "object", + "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, + "ID": { + "type": "string", + "format": "uuid", + "example": "01234567-89ab-cdef-0123-456789abcdef" + }, + "Name": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "AirDate": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z" + }, + "FeaturedProduct": { + "$ref": "#/definitions/ODataDemo.FeaturedProduct" + } + }, + "title": "Advertisement" + }, + "ODataDemo.Advertisement-create": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "format": "uuid", + "example": "01234567-89ab-cdef-0123-456789abcdef" + }, + "Name": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "AirDate": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z" + }, + "FeaturedProduct": { + "$ref": "#/definitions/ODataDemo.FeaturedProduct-create" + } + }, + "required": [ + "ID" + ], + "title": "Advertisement (for create)" + }, + "ODataDemo.Advertisement-update": { + "type": "object", + "properties": { + "Name": { + "type": [ + "string", + "null" + ], + "example": "string" + }, + "AirDate": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z" + } + }, + "title": "Advertisement (for update)" + }, + "geoPoint": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "Point" + ], + "default": "Point" + }, + "coordinates": { + "$ref": "#/definitions/geoPosition" + } + }, + "required": [ + "type", + "coordinates" + ] + }, + "geoPosition": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2 + }, + "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)", + "type": "integer", + "minimum": 0 + }, + "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)", + "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)", + "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)", + "type": "string" + } + }, + "responses": { + "error": { + "description": "Error", + "schema": { + "$ref": "#/definitions/error" + } + } + } +} diff --git a/tools/tests/odata-rw-v3.openapi3.json b/tools/tests/odata-rw-v3.openapi3.json index dbbfce90..bca6e7f3 100644 --- a/tools/tests/odata-rw-v3.openapi3.json +++ b/tools/tests/odata-rw-v3.openapi3.json @@ -2965,6 +2965,14 @@ "ODataDemo.Product": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ID": { "type": "integer", "format": "int32" @@ -3167,6 +3175,14 @@ "ODataDemo.FeaturedProduct": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ID": { "type": "integer", "format": "int32" @@ -3361,6 +3377,14 @@ "ODataDemo.ProductDetail": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ProductID": { "type": "integer", "format": "int32" @@ -3418,6 +3442,14 @@ "ODataDemo.Category": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ID": { "type": "integer", "format": "int32" @@ -3471,6 +3503,14 @@ "ODataDemo.Supplier": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ID": { "type": "integer", "format": "int32" @@ -3662,6 +3702,14 @@ "ODataDemo.Person": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ID": { "type": "integer", "format": "int32" @@ -3752,6 +3800,14 @@ "ODataDemo.Customer": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ID": { "type": "integer", "format": "int32" @@ -3848,6 +3904,14 @@ "ODataDemo.Employee": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ID": { "type": "integer", "format": "int32" @@ -3992,6 +4056,14 @@ "ODataDemo.PersonDetail": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "PersonID": { "type": "integer", "format": "int32" @@ -4106,6 +4178,14 @@ "ODataDemo.Advertisement": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ID": { "type": "string", "format": "uuid", diff --git a/tools/tests/odata-rw-v3.swagger.json b/tools/tests/odata-rw-v3.swagger.json index f1ab81db..e054c797 100644 --- a/tools/tests/odata-rw-v3.swagger.json +++ b/tools/tests/odata-rw-v3.swagger.json @@ -2571,6 +2571,14 @@ "ODataDemo.Product": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ID": { "type": "integer", "format": "int32" @@ -2741,6 +2749,14 @@ "ODataDemo.FeaturedProduct": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ID": { "type": "integer", "format": "int32" @@ -2917,6 +2933,14 @@ "ODataDemo.ProductDetail": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ProductID": { "type": "integer", "format": "int32" @@ -2973,6 +2997,14 @@ "ODataDemo.Category": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ID": { "type": "integer", "format": "int32" @@ -3035,6 +3067,14 @@ "ODataDemo.Supplier": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ID": { "type": "integer", "format": "int32" @@ -3250,6 +3290,14 @@ "ODataDemo.Person": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ID": { "type": "integer", "format": "int32" @@ -3306,6 +3354,14 @@ "ODataDemo.Customer": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ID": { "type": "integer", "format": "int32" @@ -3389,6 +3445,14 @@ "ODataDemo.Employee": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ID": { "type": "integer", "format": "int32" @@ -3508,6 +3572,14 @@ "ODataDemo.PersonDetail": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "PersonID": { "type": "integer", "format": "int32" @@ -3606,6 +3678,14 @@ "ODataDemo.Advertisement": { "type": "object", "properties": { + "@odata.id": { + "type": "string", + "readOnly": true + }, + "@odata.etag": { + "type": "string", + "readOnly": true + }, "ID": { "type": "string", "format": "uuid",