From cffcaa17f721762bda056808547065596555a60e Mon Sep 17 00:00:00 2001 From: esd Date: Sun, 3 May 2020 14:09:16 +0200 Subject: [PATCH] removed @id and @etag. @type is conditionally added. Also fixed issue with @count not being prefix in v3.0 --- examples/TripPin.openapi3.json | 182 +------ examples/annotations.openapi3.json | 29 +- examples/authorization.openapi3.json | 16 +- examples/containment.openapi3.json | 55 +- examples/csdl-16.1.openapi3.json | 68 +-- examples/descriptions.openapi3.json | 16 +- examples/example.openapi3.json | 152 +----- examples/miscellaneous.openapi3.json | 508 +----------------- examples/odata-rw-v3.openapi3.json | 160 +----- lib/csdl2openapi.js | 23 +- test/csdl2openapi.test.js | 13 - tools/V4-CSDL-to-OpenAPI.xsl | 38 +- .../Northwind-key-as-segment.openapi3.json | 84 +-- .../Northwind-key-as-segment.swagger.json | 84 +-- tools/tests/TripPin.openapi3.json | 39 +- tools/tests/TripPin.swagger.json | 39 +- tools/tests/annotations-v2.openapi3.json | 2 +- tools/tests/annotations-v2.swagger.json | 2 +- tools/tests/annotations.openapi3.json | 12 +- tools/tests/annotations.swagger.json | 12 +- tools/tests/authorization.openapi3.json | 9 +- tools/tests/authorization.swagger.json | 9 +- tools/tests/containment.openapi3.json | 18 +- tools/tests/containment.swagger.json | 18 +- tools/tests/csdl-16.1.openapi3.json | 18 +- tools/tests/csdl-16.1.swagger.json | 18 +- tools/tests/descriptions.openapi3.json | 9 +- tools/tests/descriptions.swagger.json | 9 +- tools/tests/odata-rw-v2.openapi3.json | 12 +- tools/tests/odata-rw-v2.swagger.json | 12 +- tools/tests/odata-rw-v3.openapi3.json | 70 +-- tools/tests/odata-rw-v3.swagger.json | 70 +-- 32 files changed, 185 insertions(+), 1621 deletions(-) diff --git a/examples/TripPin.openapi3.json b/examples/TripPin.openapi3.json index 294a50bc..f8254772 100644 --- a/examples/TripPin.openapi3.json +++ b/examples/TripPin.openapi3.json @@ -3256,19 +3256,6 @@ "title": "City", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "CountryRegion": { "type": "string" }, @@ -3314,19 +3301,6 @@ "title": "Location", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "Address": { "type": "string" }, @@ -3390,18 +3364,8 @@ "title": "EventLocation", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, "@odata.type": { - "readOnly": true, - "type": "string" + "$ref": "#/components/schemas/type" }, "Address": { "type": "string" @@ -3419,6 +3383,9 @@ "title": "EventLocation (for create)", "type": "object", "properties": { + "@odata.type": { + "$ref": "#/components/schemas/type" + }, "Address": { "type": "string" }, @@ -3451,18 +3418,8 @@ "title": "AirportLocation", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, "@odata.type": { - "readOnly": true, - "type": "string" + "$ref": "#/components/schemas/type" }, "Address": { "type": "string" @@ -3479,6 +3436,9 @@ "title": "AirportLocation (for create)", "type": "object", "properties": { + "@odata.type": { + "$ref": "#/components/schemas/type" + }, "Address": { "type": "string" }, @@ -3509,19 +3469,6 @@ "title": "Photo", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "Id": { "anyOf": [ { @@ -3564,19 +3511,6 @@ "title": "Person", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "UserName": { "type": "string" }, @@ -3734,19 +3668,6 @@ "title": "Airline", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "AirlineCode": { "type": "string" }, @@ -3777,19 +3698,6 @@ "title": "Airport", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "IcaoCode": { "type": "string" }, @@ -3835,19 +3743,6 @@ "title": "PlanItem", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "PlanItemId": { "type": "integer", "format": "int32" @@ -3963,18 +3858,8 @@ "title": "PublicTransportation", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, "@odata.type": { - "readOnly": true, - "type": "string" + "$ref": "#/components/schemas/type" }, "PlanItemId": { "type": "integer", @@ -4018,6 +3903,9 @@ "title": "PublicTransportation (for create)", "type": "object", "properties": { + "@odata.type": { + "$ref": "#/components/schemas/type" + }, "ConfirmationCode": { "type": "string", "nullable": true @@ -4094,18 +3982,8 @@ "title": "Flight", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, "@odata.type": { - "readOnly": true, - "type": "string" + "$ref": "#/components/schemas/type" }, "PlanItemId": { "type": "integer", @@ -4155,6 +4033,9 @@ "title": "Flight (for create)", "type": "object", "properties": { + "@odata.type": { + "$ref": "#/components/schemas/type" + }, "ConfirmationCode": { "type": "string", "nullable": true @@ -4234,18 +4115,8 @@ "title": "Event", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, "@odata.type": { - "readOnly": true, - "type": "string" + "$ref": "#/components/schemas/type" }, "PlanItemId": { "type": "integer", @@ -4286,6 +4157,9 @@ "title": "Event (for create)", "type": "object", "properties": { + "@odata.type": { + "$ref": "#/components/schemas/type" + }, "ConfirmationCode": { "type": "string", "nullable": true @@ -4356,19 +4230,6 @@ "title": "Trip", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "TripId": { "type": "integer", "format": "int32" @@ -4577,6 +4438,9 @@ "type": "number" } }, + "type": { + "type": "string" + }, "error": { "type": "object", "required": [ diff --git a/examples/annotations.openapi3.json b/examples/annotations.openapi3.json index 10f05b4c..c649b749 100644 --- a/examples/annotations.openapi3.json +++ b/examples/annotations.openapi3.json @@ -2565,19 +2565,6 @@ "title": "SinglePartKey", "type": "object", "properties": { - "@etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@id": { - "readOnly": true, - "type": "string" - }, - "@type": { - "readOnly": true, - "type": "string" - }, "ID": { "type": "string" }, @@ -3031,19 +3018,6 @@ "title": "TwoPartKey", "type": "object", "properties": { - "@etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@id": { - "readOnly": true, - "type": "string" - }, - "@type": { - "readOnly": true, - "type": "string" - }, "One": { "type": "integer", "format": "int32" @@ -3087,6 +3061,9 @@ ], "description": "The number of entities in the collection. Available when using the [$count](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptioncount) query option." }, + "type": { + "type": "string" + }, "error": { "type": "object", "required": [ diff --git a/examples/authorization.openapi3.json b/examples/authorization.openapi3.json index 56ccb32b..db0b2d73 100644 --- a/examples/authorization.openapi3.json +++ b/examples/authorization.openapi3.json @@ -277,19 +277,6 @@ "title": "Person", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "ID": { "type": "string" }, @@ -336,6 +323,9 @@ ], "description": "The number of entities in the collection. Available when using the [$count](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptioncount) query option." }, + "type": { + "type": "string" + }, "error": { "type": "object", "required": [ diff --git a/examples/containment.openapi3.json b/examples/containment.openapi3.json index 62af7619..bd39aee9 100644 --- a/examples/containment.openapi3.json +++ b/examples/containment.openapi3.json @@ -4934,19 +4934,6 @@ "title": "Whole", "type": "object", "properties": { - "@etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@id": { - "readOnly": true, - "type": "string" - }, - "@type": { - "readOnly": true, - "type": "string" - }, "ID": { "type": "string" }, @@ -5017,19 +5004,6 @@ "title": "Part", "type": "object", "properties": { - "@etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@id": { - "readOnly": true, - "type": "string" - }, - "@type": { - "readOnly": true, - "type": "string" - }, "index": { "type": "integer", "format": "int32" @@ -5118,19 +5092,6 @@ "title": "SubPart", "type": "object", "properties": { - "@etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@id": { - "readOnly": true, - "type": "string" - }, - "@type": { - "readOnly": true, - "type": "string" - }, "One": { "type": "integer", "format": "int32" @@ -5167,19 +5128,6 @@ "title": "Folder", "type": "object", "properties": { - "@etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@id": { - "readOnly": true, - "type": "string" - }, - "@type": { - "readOnly": true, - "type": "string" - }, "Name": { "type": "string" }, @@ -5241,6 +5189,9 @@ ], "description": "The number of entities in the collection. Available when using the [$count](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptioncount) query option." }, + "type": { + "type": "string" + }, "error": { "type": "object", "required": [ diff --git a/examples/csdl-16.1.openapi3.json b/examples/csdl-16.1.openapi3.json index 04391994..35fd1c41 100644 --- a/examples/csdl-16.1.openapi3.json +++ b/examples/csdl-16.1.openapi3.json @@ -1963,19 +1963,6 @@ "title": "Product", "type": "object", "properties": { - "@etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@id": { - "readOnly": true, - "type": "string" - }, - "@type": { - "readOnly": true, - "type": "string" - }, "ID": { "type": "string" }, @@ -2145,19 +2132,6 @@ "title": "Category", "type": "object", "properties": { - "@etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@id": { - "readOnly": true, - "type": "string" - }, - "@type": { - "readOnly": true, - "type": "string" - }, "ID": { "type": "integer", "format": "int32" @@ -2211,19 +2185,6 @@ "title": "Supplier", "type": "object", "properties": { - "@etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@id": { - "readOnly": true, - "type": "string" - }, - "@type": { - "readOnly": true, - "type": "string" - }, "ID": { "type": "string" }, @@ -2299,19 +2260,6 @@ "title": "Country", "type": "object", "properties": { - "@etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@id": { - "readOnly": true, - "type": "string" - }, - "@type": { - "readOnly": true, - "type": "string" - }, "Code": { "type": "string", "maxLength": 2 @@ -2353,19 +2301,6 @@ "title": "Address", "type": "object", "properties": { - "@etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@id": { - "readOnly": true, - "type": "string" - }, - "@type": { - "readOnly": true, - "type": "string" - }, "Street": { "type": "string", "nullable": true @@ -2467,6 +2402,9 @@ ], "description": "The number of entities in the collection. Available when using the [$count](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptioncount) query option." }, + "type": { + "type": "string" + }, "error": { "type": "object", "required": [ diff --git a/examples/descriptions.openapi3.json b/examples/descriptions.openapi3.json index 8a2aff62..2608a8a4 100644 --- a/examples/descriptions.openapi3.json +++ b/examples/descriptions.openapi3.json @@ -1279,19 +1279,6 @@ "title": "Entity Type - Description", "type": "object", "properties": { - "@etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@id": { - "readOnly": true, - "type": "string" - }, - "@type": { - "readOnly": true, - "type": "string" - }, "id": { "type": "string", "maxLength": 70, @@ -1333,6 +1320,9 @@ ], "description": "The number of entities in the collection. Available when using the [$count](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptioncount) query option." }, + "type": { + "type": "string" + }, "error": { "type": "object", "required": [ diff --git a/examples/example.openapi3.json b/examples/example.openapi3.json index 8c4f9c87..8d913b95 100644 --- a/examples/example.openapi3.json +++ b/examples/example.openapi3.json @@ -3032,19 +3032,6 @@ "title": "Product", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "ID": { "type": "integer", "format": "int32" @@ -3244,18 +3231,8 @@ "title": "FeaturedProduct", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, "@odata.type": { - "readOnly": true, - "type": "string" + "$ref": "#/components/schemas/type" }, "ID": { "type": "integer", @@ -3335,6 +3312,9 @@ "title": "FeaturedProduct (for create)", "type": "object", "properties": { + "@odata.type": { + "$ref": "#/components/schemas/type" + }, "ID": { "type": "integer", "format": "int32" @@ -3454,19 +3434,6 @@ "title": "ProductDetail", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "ProductID": { "type": "integer", "format": "int32" @@ -3524,19 +3491,6 @@ "title": "Category", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "ID": { "type": "integer", "format": "int32" @@ -3593,19 +3547,6 @@ "title": "Supplier", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "ID": { "type": "integer", "format": "int32" @@ -3722,19 +3663,6 @@ "title": "Address", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "Street": { "type": "string", "nullable": true @@ -3813,19 +3741,6 @@ "title": "Person", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "ID": { "type": "integer", "format": "int32" @@ -3910,18 +3825,8 @@ "title": "Customer", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, "@odata.type": { - "readOnly": true, - "type": "string" + "$ref": "#/components/schemas/type" }, "ID": { "type": "integer", @@ -3958,6 +3863,9 @@ "title": "Customer (for create)", "type": "object", "properties": { + "@odata.type": { + "$ref": "#/components/schemas/type" + }, "ID": { "type": "integer", "format": "int32" @@ -4019,18 +3927,8 @@ "title": "Employee", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, "@odata.type": { - "readOnly": true, - "type": "string" + "$ref": "#/components/schemas/type" }, "ID": { "type": "integer", @@ -4083,6 +3981,9 @@ "title": "Employee (for create)", "type": "object", "properties": { + "@odata.type": { + "$ref": "#/components/schemas/type" + }, "ID": { "type": "integer", "format": "int32" @@ -4176,19 +4077,6 @@ "title": "PersonDetail", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "PersonID": { "type": "integer", "format": "int32" @@ -4303,19 +4191,6 @@ "title": "Advertisement", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "ID": { "type": "string", "format": "uuid", @@ -4423,6 +4298,9 @@ ], "description": "The number of entities in the collection. Available when using the [$count](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptioncount) query option." }, + "type": { + "type": "string" + }, "error": { "type": "object", "required": [ diff --git a/examples/miscellaneous.openapi3.json b/examples/miscellaneous.openapi3.json index 63040ef9..2d19c002 100644 --- a/examples/miscellaneous.openapi3.json +++ b/examples/miscellaneous.openapi3.json @@ -2885,19 +2885,6 @@ "title": "Measurement", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "Dimension": { "type": "string", "maxLength": 50, @@ -2970,19 +2957,6 @@ "title": "Example7to11", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "Units": { "type": "array", "items": { @@ -3136,19 +3110,6 @@ "title": "Product", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "ID": { "type": "string" }, @@ -3207,19 +3168,6 @@ "title": "Supplier", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "ID": { "type": "string" } @@ -3245,19 +3193,6 @@ "title": "Customer", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "ID": { "type": "string" } @@ -3283,19 +3218,6 @@ "title": "Order", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "ID": { "anyOf": [ { @@ -3339,19 +3261,6 @@ "title": "Category", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "ID": { "type": "string" }, @@ -3392,19 +3301,6 @@ "title": "Employee", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "ID": { "type": "string" }, @@ -3484,18 +3380,8 @@ "title": "Manager", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, "@odata.type": { - "readOnly": true, - "type": "string" + "$ref": "#/components/schemas/type" }, "ID": { "type": "string" @@ -3543,6 +3429,9 @@ "title": "Manager (for create)", "type": "object", "properties": { + "@odata.type": { + "$ref": "#/components/schemas/type" + }, "ID": { "type": "string" }, @@ -3615,19 +3504,6 @@ "title": "Category17", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "ID": { "type": "integer", "format": "int32" @@ -3669,19 +3545,6 @@ "title": "Category18", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "Info": { "$ref": "#/components/schemas/org.example.EntityInfo" }, @@ -3721,19 +3584,6 @@ "title": "EntityInfo", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "ID": { "type": "integer", "format": "int32" @@ -3782,19 +3632,6 @@ "title": "OrderLine", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "OrderID": { "type": "integer", "format": "int32" @@ -3831,19 +3668,6 @@ "title": "Dimensions", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "Height": { "anyOf": [ { @@ -3979,19 +3803,6 @@ "title": "Product22", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "ID": { "type": "string" }, @@ -4067,19 +3878,6 @@ "title": "ShipmentBox", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "ID": { "type": "string" }, @@ -4178,19 +3976,6 @@ "title": "Size", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "Height": { "anyOf": [ { @@ -4257,19 +4042,6 @@ "title": "Product2", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "ID": { "type": "integer", "format": "int32" @@ -4323,19 +4095,6 @@ "title": "NullablePrimitiveTypes", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "NullValue": { "type": "boolean", "nullable": true, @@ -4861,19 +4620,6 @@ "title": "NonNullablePrimitiveTypes", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "NullValue": { "type": "boolean", "default": null @@ -5387,19 +5133,6 @@ "title": "Weird", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "TheKey": { "type": "string", "pattern": ".+" @@ -5750,19 +5483,6 @@ "title": "Address", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "Street": { "type": "string", "nullable": true @@ -5883,21 +5603,6 @@ } }, "Model1.City": { - "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - } - }, "title": "City", "type": "object" }, @@ -5910,21 +5615,6 @@ "type": "object" }, "Model1.Region": { - "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - } - }, "title": "Region", "type": "object" }, @@ -5937,21 +5627,6 @@ "type": "object" }, "Model1.Country": { - "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - } - }, "title": "Country", "type": "object" }, @@ -5964,21 +5639,6 @@ "type": "object" }, "Model1.Planet": { - "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - } - }, "title": "Planet", "type": "object" }, @@ -5994,19 +5654,6 @@ "title": "NavigationOnly", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "Planet": { "anyOf": [ { @@ -6036,21 +5683,6 @@ "type": "object" }, "Model1.AnnotationOnly": { - "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - } - }, "title": "AnnotationOnly", "type": "object" }, @@ -6066,19 +5698,6 @@ "title": "Order", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "Quantity": { "anyOf": [ { @@ -6220,21 +5839,6 @@ "X.PersonType": { "title": "PersonType", "type": "object", - "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - } - }, "anyOf": [ { "$ref": "#/components/schemas/Y.DeveloperType" @@ -6265,21 +5869,6 @@ "X.MovieType": { "title": "MovieType", "type": "object", - "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - } - }, "anyOf": [ { "$ref": "#/components/schemas/Y.ArchivedMovieType" @@ -6308,21 +5897,6 @@ ] }, "X.FriendType": { - "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - } - }, "title": "FriendType", "type": "object" }, @@ -6336,24 +5910,19 @@ }, "Y.DeveloperType": { "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, "@odata.type": { - "readOnly": true, - "type": "string" + "$ref": "#/components/schemas/type" } }, "title": "DeveloperType", "type": "object" }, "Y.DeveloperType-create": { + "properties": { + "@odata.type": { + "$ref": "#/components/schemas/type" + } + }, "title": "DeveloperType (for create)", "type": "object" }, @@ -6365,19 +5934,6 @@ "title": "ScrumTeamType", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "ScrumMaster": { "anyOf": [ { @@ -6420,18 +5976,8 @@ "title": "ArchivedMovieType", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, "@odata.type": { - "readOnly": true, - "type": "string" + "$ref": "#/components/schemas/type" }, "ArchivedAt": { "type": "string", @@ -6445,6 +5991,9 @@ "title": "ArchivedMovieType (for create)", "type": "object", "properties": { + "@odata.type": { + "$ref": "#/components/schemas/type" + }, "ArchivedAt": { "type": "string", "format": "date", @@ -6469,19 +6018,6 @@ "title": "SomeThingType", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "SomeProperty": { "type": "string", "nullable": true @@ -6545,19 +6081,6 @@ "title": "ChangeTrackingType", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "InlineableStreamProperties": { "type": "array", "items": { @@ -6630,6 +6153,9 @@ "type": "number" } }, + "type": { + "type": "string" + }, "error": { "type": "object", "required": [ diff --git a/examples/odata-rw-v3.openapi3.json b/examples/odata-rw-v3.openapi3.json index 4b9a6617..92d56476 100644 --- a/examples/odata-rw-v3.openapi3.json +++ b/examples/odata-rw-v3.openapi3.json @@ -3040,19 +3040,6 @@ "title": "Product", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "ID": { "type": "integer", "format": "int32" @@ -3092,7 +3079,7 @@ "format": "double", "example": 3.14 }, - "Categories@count": { + "Categories@odata.count": { "$ref": "#/components/schemas/count" }, "Categories": { @@ -3252,18 +3239,8 @@ "title": "FeaturedProduct", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, "@odata.type": { - "readOnly": true, - "type": "string" + "$ref": "#/components/schemas/type" }, "ID": { "type": "integer", @@ -3304,7 +3281,7 @@ "format": "double", "example": 3.14 }, - "Categories@count": { + "Categories@odata.count": { "$ref": "#/components/schemas/count" }, "Categories": { @@ -3343,6 +3320,9 @@ "title": "FeaturedProduct (for create)", "type": "object", "properties": { + "@odata.type": { + "$ref": "#/components/schemas/type" + }, "ID": { "type": "integer", "format": "int32" @@ -3462,19 +3442,6 @@ "title": "ProductDetail", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "ProductID": { "type": "integer", "format": "int32" @@ -3532,19 +3499,6 @@ "title": "Category", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "ID": { "type": "integer", "format": "int32" @@ -3553,7 +3507,7 @@ "type": "string", "nullable": true }, - "Products@count": { + "Products@odata.count": { "$ref": "#/components/schemas/count" }, "Products": { @@ -3601,19 +3555,6 @@ "title": "Supplier", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "ID": { "type": "integer", "format": "int32" @@ -3642,7 +3583,7 @@ "type": "integer", "format": "int32" }, - "Products@count": { + "Products@odata.count": { "$ref": "#/components/schemas/count" }, "Products": { @@ -3730,19 +3671,6 @@ "title": "Address", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "Street": { "type": "string", "nullable": true @@ -3821,19 +3749,6 @@ "title": "Person", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "ID": { "type": "integer", "format": "int32" @@ -3918,18 +3833,8 @@ "title": "Customer", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, "@odata.type": { - "readOnly": true, - "type": "string" + "$ref": "#/components/schemas/type" }, "ID": { "type": "integer", @@ -3966,6 +3871,9 @@ "title": "Customer (for create)", "type": "object", "properties": { + "@odata.type": { + "$ref": "#/components/schemas/type" + }, "ID": { "type": "integer", "format": "int32" @@ -4027,18 +3935,8 @@ "title": "Employee", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, "@odata.type": { - "readOnly": true, - "type": "string" + "$ref": "#/components/schemas/type" }, "ID": { "type": "integer", @@ -4091,6 +3989,9 @@ "title": "Employee (for create)", "type": "object", "properties": { + "@odata.type": { + "$ref": "#/components/schemas/type" + }, "ID": { "type": "integer", "format": "int32" @@ -4184,19 +4085,6 @@ "title": "PersonDetail", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "PersonID": { "type": "integer", "format": "int32" @@ -4311,19 +4199,6 @@ "title": "Advertisement", "type": "object", "properties": { - "@odata.etag": { - "example": "W/\"08D7D40891852C76\"", - "readOnly": true, - "type": "string" - }, - "@odata.id": { - "readOnly": true, - "type": "string" - }, - "@odata.type": { - "readOnly": true, - "type": "string" - }, "ID": { "type": "string", "format": "uuid", @@ -4431,6 +4306,9 @@ "type": "number" } }, + "type": { + "type": "string" + }, "error": { "type": "object", "required": [ diff --git a/lib/csdl2openapi.js b/lib/csdl2openapi.js index 7084c8ea..4365e0da 100644 --- a/lib/csdl2openapi.js +++ b/lib/csdl2openapi.js @@ -1329,7 +1329,7 @@ module.exports.csdl2openapi = function ( type: 'object', title: 'Collection of ' + nameParts(type.$Type || 'Edm.String').name, properties: { - [csdl.$Version > '4.0' ? '@count' : '@odata.count']: ref('count'), + [`@${csdl.$Version > '4.0' ? '' : 'odata.'}count`]: ref('count'), value: s } } @@ -1402,6 +1402,7 @@ module.exports.csdl2openapi = function ( inlineTypes(s); if (csdl.$EntityContainer) { + s.type = type(); s.count = count(); s.error = error(); } @@ -1491,20 +1492,22 @@ module.exports.csdl2openapi = function ( const updName = allName + '-update'; const isKey = keyMap(type); const required = Object.keys(isKey); - const metadata = csdl.$Version > '4.0' ? - { '@id':{ type: "string", readOnly: true }, '@etag': { type: 'string', readOnly: true, example: "W/\"08D7D40891852C76\"" }, '@type':{ type: 'string', readOnly: true } } : - { '@odata.id':{ type: "string", readOnly: true }, '@odata.etag': { type: 'string', readOnly: true, example: "W/\"08D7D40891852C76\"" }, '@odata.type':{ type: 'string', readOnly: true } }; - const allProperties = { ...metadata }; + const allProperties = {}; const creProperties = {}; const updProperties = {}; + if (type && type.$BaseType) { + allProperties[`@${csdl.$Version > '4.0' ? '' : 'odata.'}type`] = ref('type'); + creProperties[`@${csdl.$Version > '4.0' ? '' : 'odata.'}type`] = ref('type'); + } + const properties = propertiesOfStructuredType(type); Object.keys(properties).forEach(name => { const property = properties[name]; allProperties[name] = schema(property); if (property.$Kind == 'NavigationProperty') { if (property.$Collection) { - allProperties[`${name}@${csdl.$Version === '4.0' ? 'odata.' : ''}count`] = ref('count'); + allProperties[`${name}@${csdl.$Version > '4.0' ? '' : 'odata.'}count`] = ref('count'); } creProperties[name] = schema(property, '-create'); if (deepUpdate) @@ -1695,6 +1698,14 @@ module.exports.csdl2openapi = function ( }; } + /** + * Construct OData type response + * @return {object} Type response schema + */ + function type() { + return { type: "string" }; + } + /** * Construct Schema Object for model object referencing a type * @param {object} modelElement referencing a type diff --git a/test/csdl2openapi.test.js b/test/csdl2openapi.test.js index 94687478..e9316585 100644 --- a/test/csdl2openapi.test.js +++ b/test/csdl2openapi.test.js @@ -156,19 +156,6 @@ describe('Edge cases', function () { type: 'object', title: 'Core.Description', properties: { - "@odata.etag": { - example: "W/\"08D7D40891852C76\"", - readOnly: true, - type: "string", - }, - "@odata.id": { - readOnly: true, - type: "string", - }, - "@odata.type": { - readOnly: true, - type: "string", - }, key: { type: 'string' } } }, diff --git a/tools/V4-CSDL-to-OpenAPI.xsl b/tools/V4-CSDL-to-OpenAPI.xsl index e558ae30..26b83237 100644 --- a/tools/V4-CSDL-to-OpenAPI.xsl +++ b/tools/V4-CSDL-to-OpenAPI.xsl @@ -899,16 +899,13 @@ - "@OData.metadata":{ - "type":"object", - "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/\"X'000000000000D2F3'\""}} - }, - + "metadata":{"type":"object", + "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"}} + }, - "@OData.etag":{"type":"string","example":"W/\"08D7D40891852C76\""}, - "@OData.type":{"type":"string"}, + "type":{"type":"string"}, "count": @@ -1446,26 +1443,17 @@ "__metadata":{"$ref":" - %40OData.metadata"}, - - - "@odata.etag":{"$ref":" - - %40OData.etag"}, - - "@odata.type":{"$ref":" - - %40OData.type"}, - + metadata"}, - "@etag":{"$ref":" - - %40OData.etag"}, - "@type":{"$ref":" + "@ + + odata. + + type":{"$ref":" - %40OData.type"}, + type"}, @@ -4305,7 +4293,7 @@ @ - + odata. count":{"$ref":" diff --git a/tools/tests/Northwind-key-as-segment.openapi3.json b/tools/tests/Northwind-key-as-segment.openapi3.json index 9eaf33c8..7f0d5387 100644 --- a/tools/tests/Northwind-key-as-segment.openapi3.json +++ b/tools/tests/Northwind-key-as-segment.openapi3.json @@ -10116,9 +10116,6 @@ "NorthwindModel.Category": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "CategoryID": { "type": "integer", "format": "int32" @@ -10199,9 +10196,6 @@ "NorthwindModel.CustomerDemographic": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "CustomerTypeID": { "type": "string", "maxLength": 10 @@ -10255,9 +10249,6 @@ "NorthwindModel.Customer": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "CustomerID": { "type": "string", "maxLength": 5 @@ -10458,9 +10449,6 @@ "NorthwindModel.Employee": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "EmployeeID": { "type": "integer", "format": "int32" @@ -10794,9 +10782,6 @@ "NorthwindModel.Order_Detail": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "OrderID": { "type": "integer", "format": "int32" @@ -10934,9 +10919,6 @@ "NorthwindModel.Order": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "OrderID": { "type": "integer", "format": "int32" @@ -11257,9 +11239,6 @@ "NorthwindModel.Product": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "ProductID": { "type": "integer", "format": "int32" @@ -11486,9 +11465,6 @@ "NorthwindModel.Region": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "RegionID": { "type": "integer", "format": "int32" @@ -11542,9 +11518,6 @@ "NorthwindModel.Shipper": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "ShipperID": { "type": "integer", "format": "int32" @@ -11613,9 +11586,6 @@ "NorthwindModel.Supplier": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "SupplierID": { "type": "integer", "format": "int32" @@ -11816,9 +11786,6 @@ "NorthwindModel.Territory": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "TerritoryID": { "type": "string", "maxLength": 20 @@ -11890,9 +11857,6 @@ "NorthwindModel.Alphabetical_list_of_product": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "ProductID": { "type": "integer", "format": "int32" @@ -12079,9 +12043,6 @@ "NorthwindModel.Category_Sales_for_1997": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "CategoryName": { "type": "string", "maxLength": 15 @@ -12153,9 +12114,6 @@ "NorthwindModel.Current_Product_List": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "ProductID": { "type": "integer", "format": "int32" @@ -12192,9 +12150,6 @@ "NorthwindModel.Customer_and_Suppliers_by_City": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "City": { "type": "string", "nullable": true, @@ -12263,9 +12218,6 @@ "NorthwindModel.Invoice": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "ShipName": { "type": "string", "nullable": true, @@ -12719,9 +12671,6 @@ "NorthwindModel.Order_Details_Extended": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "OrderID": { "type": "integer", "format": "int32" @@ -12872,9 +12821,6 @@ "NorthwindModel.Order_Subtotal": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "OrderID": { "type": "integer", "format": "int32" @@ -12946,9 +12892,6 @@ "NorthwindModel.Orders_Qry": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "OrderID": { "type": "integer", "format": "int32" @@ -13293,9 +13236,6 @@ "NorthwindModel.Product_Sales_for_1997": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "CategoryName": { "type": "string", "maxLength": 15 @@ -13376,9 +13316,6 @@ "NorthwindModel.Products_Above_Average_Price": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "ProductName": { "type": "string", "maxLength": 40 @@ -13450,9 +13387,6 @@ "NorthwindModel.Products_by_Category": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "CategoryName": { "type": "string", "maxLength": 15 @@ -13528,9 +13462,6 @@ "NorthwindModel.Sales_by_Category": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "CategoryID": { "type": "integer", "format": "int32" @@ -13620,9 +13551,6 @@ "NorthwindModel.Sales_Totals_by_Amount": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "SaleAmount": { "anyOf": [ { @@ -13721,9 +13649,6 @@ "NorthwindModel.Summary_of_Sales_by_Quarter": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "ShippedDate": { "type": "string", "nullable": true, @@ -13813,9 +13738,6 @@ "NorthwindModel.Summary_of_Sales_by_Year": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "ShippedDate": { "type": "string", "nullable": true, @@ -13902,11 +13824,7 @@ }, "title": "Summary_of_Sales_by_Year (for update)" }, - "@OData.etag": { - "type": "string", - "example": "W/\"08D7D40891852C76\"" - }, - "@OData.type": { + "type": { "type": "string" }, "count": { diff --git a/tools/tests/Northwind-key-as-segment.swagger.json b/tools/tests/Northwind-key-as-segment.swagger.json index eb5c89f0..b3fbbd70 100644 --- a/tools/tests/Northwind-key-as-segment.swagger.json +++ b/tools/tests/Northwind-key-as-segment.swagger.json @@ -8836,9 +8836,6 @@ "NorthwindModel.Category": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/definitions/%40OData.etag" - }, "CategoryID": { "type": "integer", "format": "int32" @@ -8934,9 +8931,6 @@ "NorthwindModel.CustomerDemographic": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/definitions/%40OData.etag" - }, "CustomerTypeID": { "type": "string", "maxLength": 10 @@ -8999,9 +8993,6 @@ "NorthwindModel.Customer": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/definitions/%40OData.etag" - }, "CustomerID": { "type": "string", "maxLength": 5 @@ -9283,9 +9274,6 @@ "NorthwindModel.Employee": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/definitions/%40OData.etag" - }, "EmployeeID": { "type": "integer", "format": "int32" @@ -9732,9 +9720,6 @@ "NorthwindModel.Order_Detail": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/definitions/%40OData.etag" - }, "OrderID": { "type": "integer", "format": "int32" @@ -9848,9 +9833,6 @@ "NorthwindModel.Order": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/definitions/%40OData.etag" - }, "OrderID": { "type": "integer", "format": "int32" @@ -10222,9 +10204,6 @@ "NorthwindModel.Product": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/definitions/%40OData.etag" - }, "ProductID": { "type": "integer", "format": "int32" @@ -10458,9 +10437,6 @@ "NorthwindModel.Region": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/definitions/%40OData.etag" - }, "RegionID": { "type": "integer", "format": "int32" @@ -10514,9 +10490,6 @@ "NorthwindModel.Shipper": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/definitions/%40OData.etag" - }, "ShipperID": { "type": "integer", "format": "int32" @@ -10594,9 +10567,6 @@ "NorthwindModel.Supplier": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/definitions/%40OData.etag" - }, "SupplierID": { "type": "integer", "format": "int32" @@ -10887,9 +10857,6 @@ "NorthwindModel.Territory": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/definitions/%40OData.etag" - }, "TerritoryID": { "type": "string", "maxLength": 20 @@ -10961,9 +10928,6 @@ "NorthwindModel.Alphabetical_list_of_product": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/definitions/%40OData.etag" - }, "ProductID": { "type": "integer", "format": "int32" @@ -11177,9 +11141,6 @@ "NorthwindModel.Category_Sales_for_1997": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/definitions/%40OData.etag" - }, "CategoryName": { "type": "string", "maxLength": 15 @@ -11239,9 +11200,6 @@ "NorthwindModel.Current_Product_List": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/definitions/%40OData.etag" - }, "ProductID": { "type": "integer", "format": "int32" @@ -11278,9 +11236,6 @@ "NorthwindModel.Customer_and_Suppliers_by_City": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/definitions/%40OData.etag" - }, "City": { "type": [ "string", @@ -11367,9 +11322,6 @@ "NorthwindModel.Invoice": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/definitions/%40OData.etag" - }, "ShipName": { "type": [ "string", @@ -11909,9 +11861,6 @@ "NorthwindModel.Order_Details_Extended": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/definitions/%40OData.etag" - }, "OrderID": { "type": "integer", "format": "int32" @@ -12034,9 +11983,6 @@ "NorthwindModel.Order_Subtotal": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/definitions/%40OData.etag" - }, "OrderID": { "type": "integer", "format": "int32" @@ -12096,9 +12042,6 @@ "NorthwindModel.Orders_Qry": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/definitions/%40OData.etag" - }, "OrderID": { "type": "integer", "format": "int32" @@ -12569,9 +12512,6 @@ "NorthwindModel.Product_Sales_for_1997": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/definitions/%40OData.etag" - }, "CategoryName": { "type": "string", "maxLength": 15 @@ -12640,9 +12580,6 @@ "NorthwindModel.Products_Above_Average_Price": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/definitions/%40OData.etag" - }, "ProductName": { "type": "string", "maxLength": 40 @@ -12702,9 +12639,6 @@ "NorthwindModel.Products_by_Category": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/definitions/%40OData.etag" - }, "CategoryName": { "type": "string", "maxLength": 15 @@ -12795,9 +12729,6 @@ "NorthwindModel.Sales_by_Category": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/definitions/%40OData.etag" - }, "CategoryID": { "type": "integer", "format": "int32" @@ -12875,9 +12806,6 @@ "NorthwindModel.Sales_Totals_by_Amount": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/definitions/%40OData.etag" - }, "SaleAmount": { "type": [ "number", @@ -12970,9 +12898,6 @@ "NorthwindModel.Summary_of_Sales_by_Quarter": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/definitions/%40OData.etag" - }, "ShippedDate": { "type": [ "string", @@ -13056,9 +12981,6 @@ "NorthwindModel.Summary_of_Sales_by_Year": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/definitions/%40OData.etag" - }, "ShippedDate": { "type": [ "string", @@ -13139,11 +13061,7 @@ }, "title": "Summary_of_Sales_by_Year (for update)" }, - "@OData.etag": { - "type": "string", - "example": "W/\"08D7D40891852C76\"" - }, - "@OData.type": { + "type": { "type": "string" }, "count": { diff --git a/tools/tests/TripPin.openapi3.json b/tools/tests/TripPin.openapi3.json index e1bcac1a..301fcb7e 100644 --- a/tools/tests/TripPin.openapi3.json +++ b/tools/tests/TripPin.openapi3.json @@ -3438,9 +3438,6 @@ "Microsoft.OData.SampleService.Models.TripPin.Photo": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "Id": { "anyOf": [ { @@ -3483,9 +3480,6 @@ "Microsoft.OData.SampleService.Models.TripPin.Person": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "UserName": { "type": "string" }, @@ -3637,9 +3631,6 @@ "Microsoft.OData.SampleService.Models.TripPin.Airline": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "AirlineCode": { "type": "string" }, @@ -3670,9 +3661,6 @@ "Microsoft.OData.SampleService.Models.TripPin.Airport": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "IcaoCode": { "type": "string" }, @@ -3718,9 +3706,6 @@ "Microsoft.OData.SampleService.Models.TripPin.PlanItem": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "PlanItemId": { "type": "integer", "format": "int32" @@ -3842,11 +3827,8 @@ "Microsoft.OData.SampleService.Models.TripPin.PublicTransportation": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "@odata.type": { - "$ref": "#/components/schemas/%40OData.type" + "$ref": "#/components/schemas/type" }, "PlanItemId": { "type": "integer", @@ -3972,11 +3954,8 @@ "Microsoft.OData.SampleService.Models.TripPin.Flight": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "@odata.type": { - "$ref": "#/components/schemas/%40OData.type" + "$ref": "#/components/schemas/type" }, "PlanItemId": { "type": "integer", @@ -4105,11 +4084,8 @@ "Microsoft.OData.SampleService.Models.TripPin.Event": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "@odata.type": { - "$ref": "#/components/schemas/%40OData.type" + "$ref": "#/components/schemas/type" }, "PlanItemId": { "type": "integer", @@ -4220,9 +4196,6 @@ "Microsoft.OData.SampleService.Models.TripPin.Trip": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "TripId": { "type": "integer", "format": "int32" @@ -4389,11 +4362,7 @@ }, "title": "Trip (for update)" }, - "@OData.etag": { - "type": "string", - "example": "W/\"08D7D40891852C76\"" - }, - "@OData.type": { + "type": { "type": "string" }, "count": { diff --git a/tools/tests/TripPin.swagger.json b/tools/tests/TripPin.swagger.json index 177ed736..907c024b 100644 --- a/tools/tests/TripPin.swagger.json +++ b/tools/tests/TripPin.swagger.json @@ -3002,9 +3002,6 @@ "Microsoft.OData.SampleService.Models.TripPin.Photo": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/definitions/%40OData.etag" - }, "Id": { "type": [ "integer", @@ -3052,9 +3049,6 @@ "Microsoft.OData.SampleService.Models.TripPin.Person": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/definitions/%40OData.etag" - }, "UserName": { "type": "string" }, @@ -3177,9 +3171,6 @@ "Microsoft.OData.SampleService.Models.TripPin.Airline": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/definitions/%40OData.etag" - }, "AirlineCode": { "type": "string" }, @@ -3210,9 +3201,6 @@ "Microsoft.OData.SampleService.Models.TripPin.Airport": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/definitions/%40OData.etag" - }, "IcaoCode": { "type": "string" }, @@ -3258,9 +3246,6 @@ "Microsoft.OData.SampleService.Models.TripPin.PlanItem": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/definitions/%40OData.etag" - }, "PlanItemId": { "type": "integer", "format": "int32" @@ -3376,11 +3361,8 @@ "Microsoft.OData.SampleService.Models.TripPin.PublicTransportation": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/definitions/%40OData.etag" - }, "@odata.type": { - "$ref": "#/definitions/%40OData.type" + "$ref": "#/definitions/type" }, "PlanItemId": { "type": "integer", @@ -3518,11 +3500,8 @@ "Microsoft.OData.SampleService.Models.TripPin.Flight": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/definitions/%40OData.etag" - }, "@odata.type": { - "$ref": "#/definitions/%40OData.type" + "$ref": "#/definitions/type" }, "PlanItemId": { "type": "integer", @@ -3687,11 +3666,8 @@ "Microsoft.OData.SampleService.Models.TripPin.Event": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/definitions/%40OData.etag" - }, "@odata.type": { - "$ref": "#/definitions/%40OData.type" + "$ref": "#/definitions/type" }, "PlanItemId": { "type": "integer", @@ -3838,9 +3814,6 @@ "Microsoft.OData.SampleService.Models.TripPin.Trip": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/definitions/%40OData.etag" - }, "TripId": { "type": "integer", "format": "int32" @@ -4010,11 +3983,7 @@ }, "title": "Trip (for update)" }, - "@OData.etag": { - "type": "string", - "example": "W/\"08D7D40891852C76\"" - }, - "@OData.type": { + "type": { "type": "string" }, "count": { diff --git a/tools/tests/annotations-v2.openapi3.json b/tools/tests/annotations-v2.openapi3.json index e9fe4405..088b99de 100644 --- a/tools/tests/annotations-v2.openapi3.json +++ b/tools/tests/annotations-v2.openapi3.json @@ -14,7 +14,7 @@ "type": "object", "properties": { "__metadata": { - "$ref": "#/components/schemas/%40OData.metadata" + "$ref": "#/components/schemas/metadata" }, "ID": { "type": "string" diff --git a/tools/tests/annotations-v2.swagger.json b/tools/tests/annotations-v2.swagger.json index ab2375b2..40aa0f53 100644 --- a/tools/tests/annotations-v2.swagger.json +++ b/tools/tests/annotations-v2.swagger.json @@ -13,7 +13,7 @@ "type": "object", "properties": { "__metadata": { - "$ref": "#/definitions/%40OData.metadata" + "$ref": "#/definitions/metadata" }, "ID": { "type": "string" diff --git a/tools/tests/annotations.openapi3.json b/tools/tests/annotations.openapi3.json index 6d5e068b..b33a40ff 100644 --- a/tools/tests/annotations.openapi3.json +++ b/tools/tests/annotations.openapi3.json @@ -2596,9 +2596,6 @@ "Supported.Annotations.SinglePartKey": { "type": "object", "properties": { - "@etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "ID": { "type": "string" }, @@ -3043,9 +3040,6 @@ "Supported.Annotations.TwoPartKey": { "type": "object", "properties": { - "@etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "One": { "type": "integer", "format": "int32" @@ -3079,11 +3073,7 @@ "type": "object", "title": "TwoPartKey (for update)" }, - "@OData.etag": { - "type": "string", - "example": "W/\"08D7D40891852C76\"" - }, - "@OData.type": { + "type": { "type": "string" }, "count": { diff --git a/tools/tests/annotations.swagger.json b/tools/tests/annotations.swagger.json index ded046af..2b86ab2d 100644 --- a/tools/tests/annotations.swagger.json +++ b/tools/tests/annotations.swagger.json @@ -2292,9 +2292,6 @@ "Supported.Annotations.SinglePartKey": { "type": "object", "properties": { - "@etag": { - "$ref": "#/definitions/%40OData.etag" - }, "ID": { "type": "string" }, @@ -2736,9 +2733,6 @@ "Supported.Annotations.TwoPartKey": { "type": "object", "properties": { - "@etag": { - "$ref": "#/definitions/%40OData.etag" - }, "One": { "type": "integer", "format": "int32" @@ -2772,11 +2766,7 @@ "type": "object", "title": "TwoPartKey (for update)" }, - "@OData.etag": { - "type": "string", - "example": "W/\"08D7D40891852C76\"" - }, - "@OData.type": { + "type": { "type": "string" }, "count": { diff --git a/tools/tests/authorization.openapi3.json b/tools/tests/authorization.openapi3.json index 003857c0..edc7d682 100644 --- a/tools/tests/authorization.openapi3.json +++ b/tools/tests/authorization.openapi3.json @@ -276,9 +276,6 @@ "auth.example.Person": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "ID": { "type": "string" }, @@ -315,11 +312,7 @@ }, "title": "Person (for update)" }, - "@OData.etag": { - "type": "string", - "example": "W/\"08D7D40891852C76\"" - }, - "@OData.type": { + "type": { "type": "string" }, "count": { diff --git a/tools/tests/authorization.swagger.json b/tools/tests/authorization.swagger.json index 06caca2e..cc959edf 100644 --- a/tools/tests/authorization.swagger.json +++ b/tools/tests/authorization.swagger.json @@ -255,9 +255,6 @@ "auth.example.Person": { "type": "object", "properties": { - "@odata.etag": { - "$ref": "#/definitions/%40OData.etag" - }, "ID": { "type": "string" }, @@ -303,11 +300,7 @@ }, "title": "Person (for update)" }, - "@OData.etag": { - "type": "string", - "example": "W/\"08D7D40891852C76\"" - }, - "@OData.type": { + "type": { "type": "string" }, "count": { diff --git a/tools/tests/containment.openapi3.json b/tools/tests/containment.openapi3.json index 8543264f..226f924e 100644 --- a/tools/tests/containment.openapi3.json +++ b/tools/tests/containment.openapi3.json @@ -4945,9 +4945,6 @@ "Containment.Whole": { "type": "object", "properties": { - "@etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "ID": { "type": "string" }, @@ -5015,9 +5012,6 @@ "Containment.Part": { "type": "object", "properties": { - "@etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "index": { "type": "integer", "format": "int32" @@ -5097,9 +5091,6 @@ "Containment.SubPart": { "type": "object", "properties": { - "@etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "One": { "type": "integer", "format": "int32" @@ -5136,9 +5127,6 @@ "Containment.Folder": { "type": "object", "properties": { - "@etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "Name": { "type": "string" }, @@ -5187,11 +5175,7 @@ }, "title": "Folder (for update)" }, - "@OData.etag": { - "type": "string", - "example": "W/\"08D7D40891852C76\"" - }, - "@OData.type": { + "type": { "type": "string" }, "count": { diff --git a/tools/tests/containment.swagger.json b/tools/tests/containment.swagger.json index facc16b3..e21fe2f7 100644 --- a/tools/tests/containment.swagger.json +++ b/tools/tests/containment.swagger.json @@ -4325,9 +4325,6 @@ "Containment.Whole": { "type": "object", "properties": { - "@etag": { - "$ref": "#/definitions/%40OData.etag" - }, "ID": { "type": "string" }, @@ -4394,9 +4391,6 @@ "Containment.Part": { "type": "object", "properties": { - "@etag": { - "$ref": "#/definitions/%40OData.etag" - }, "index": { "type": "integer", "format": "int32" @@ -4466,9 +4460,6 @@ "Containment.SubPart": { "type": "object", "properties": { - "@etag": { - "$ref": "#/definitions/%40OData.etag" - }, "One": { "type": "integer", "format": "int32" @@ -4505,9 +4496,6 @@ "Containment.Folder": { "type": "object", "properties": { - "@etag": { - "$ref": "#/definitions/%40OData.etag" - }, "Name": { "type": "string" }, @@ -4565,11 +4553,7 @@ }, "title": "Folder (for update)" }, - "@OData.etag": { - "type": "string", - "example": "W/\"08D7D40891852C76\"" - }, - "@OData.type": { + "type": { "type": "string" }, "count": { diff --git a/tools/tests/csdl-16.1.openapi3.json b/tools/tests/csdl-16.1.openapi3.json index 4509b734..5597573b 100644 --- a/tools/tests/csdl-16.1.openapi3.json +++ b/tools/tests/csdl-16.1.openapi3.json @@ -1854,9 +1854,6 @@ "ODataDemo.Product": { "type": "object", "properties": { - "@etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "ID": { "type": "string" }, @@ -2026,9 +2023,6 @@ "ODataDemo.Category": { "type": "object", "properties": { - "@etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "ID": { "type": "integer", "format": "int32" @@ -2079,9 +2073,6 @@ "ODataDemo.Supplier": { "type": "object", "properties": { - "@etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "ID": { "type": "string" }, @@ -2154,9 +2145,6 @@ "ODataDemo.Country": { "type": "object", "properties": { - "@etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "Code": { "type": "string", "maxLength": 2 @@ -2289,11 +2277,7 @@ }, "title": "Address (for update)" }, - "@OData.etag": { - "type": "string", - "example": "W/\"08D7D40891852C76\"" - }, - "@OData.type": { + "type": { "type": "string" }, "count": { diff --git a/tools/tests/csdl-16.1.swagger.json b/tools/tests/csdl-16.1.swagger.json index d30a6ab9..87a19274 100644 --- a/tools/tests/csdl-16.1.swagger.json +++ b/tools/tests/csdl-16.1.swagger.json @@ -1627,9 +1627,6 @@ "ODataDemo.Product": { "type": "object", "properties": { - "@etag": { - "$ref": "#/definitions/%40OData.etag" - }, "ID": { "type": "string" }, @@ -1813,9 +1810,6 @@ "ODataDemo.Category": { "type": "object", "properties": { - "@etag": { - "$ref": "#/definitions/%40OData.etag" - }, "ID": { "type": "integer", "format": "int32" @@ -1866,9 +1860,6 @@ "ODataDemo.Supplier": { "type": "object", "properties": { - "@etag": { - "$ref": "#/definitions/%40OData.etag" - }, "ID": { "type": "string" }, @@ -1950,9 +1941,6 @@ "ODataDemo.Country": { "type": "object", "properties": { - "@etag": { - "$ref": "#/definitions/%40OData.etag" - }, "Code": { "type": "string", "maxLength": 2 @@ -2129,11 +2117,7 @@ }, "title": "Address (for update)" }, - "@OData.etag": { - "type": "string", - "example": "W/\"08D7D40891852C76\"" - }, - "@OData.type": { + "type": { "type": "string" }, "count": { diff --git a/tools/tests/descriptions.openapi3.json b/tools/tests/descriptions.openapi3.json index db8cc061..ec745c45 100644 --- a/tools/tests/descriptions.openapi3.json +++ b/tools/tests/descriptions.openapi3.json @@ -1275,11 +1275,7 @@ }, "components": { "schemas": { - "@OData.etag": { - "type": "string", - "example": "W/\"08D7D40891852C76\"" - }, - "@OData.type": { + "type": { "type": "string" }, "count": { @@ -1347,9 +1343,6 @@ "descriptions.entity": { "type": "object", "properties": { - "@etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "id": { "type": "string", "maxLength": 70, diff --git a/tools/tests/descriptions.swagger.json b/tools/tests/descriptions.swagger.json index 9f2a1c3e..2fc725c5 100644 --- a/tools/tests/descriptions.swagger.json +++ b/tools/tests/descriptions.swagger.json @@ -1179,11 +1179,7 @@ } }, "definitions": { - "@OData.etag": { - "type": "string", - "example": "W/\"08D7D40891852C76\"" - }, - "@OData.type": { + "type": { "type": "string" }, "count": { @@ -1251,9 +1247,6 @@ "descriptions.entity": { "type": "object", "properties": { - "@etag": { - "$ref": "#/definitions/%40OData.etag" - }, "id": { "type": "string", "maxLength": 70, diff --git a/tools/tests/odata-rw-v2.openapi3.json b/tools/tests/odata-rw-v2.openapi3.json index 745a344d..fd480f56 100644 --- a/tools/tests/odata-rw-v2.openapi3.json +++ b/tools/tests/odata-rw-v2.openapi3.json @@ -1491,7 +1491,7 @@ "type": "object", "properties": { "__metadata": { - "$ref": "#/components/schemas/%40OData.metadata" + "$ref": "#/components/schemas/metadata" }, "ID": { "type": "integer", @@ -1636,7 +1636,7 @@ "type": "object", "properties": { "__metadata": { - "$ref": "#/components/schemas/%40OData.metadata" + "$ref": "#/components/schemas/metadata" }, "ID": { "type": "integer", @@ -1702,7 +1702,7 @@ "type": "object", "properties": { "__metadata": { - "$ref": "#/components/schemas/%40OData.metadata" + "$ref": "#/components/schemas/metadata" }, "ID": { "type": "integer", @@ -1863,7 +1863,7 @@ }, "title": "Address (for update)" }, - "@OData.metadata": { + "metadata": { "type": "object", "description": "This name/value pair is not data, but instead, specifies the metadata for the EntityType instance that the JSON object represents.", "properties": { @@ -1875,10 +1875,6 @@ }, "type": { "type": "string" - }, - "etag": { - "type": "string", - "example": "W/\"X'000000000000D2F3'\"" } } }, diff --git a/tools/tests/odata-rw-v2.swagger.json b/tools/tests/odata-rw-v2.swagger.json index 06cfecce..9891dba1 100644 --- a/tools/tests/odata-rw-v2.swagger.json +++ b/tools/tests/odata-rw-v2.swagger.json @@ -1324,7 +1324,7 @@ "type": "object", "properties": { "__metadata": { - "$ref": "#/definitions/%40OData.metadata" + "$ref": "#/definitions/metadata" }, "ID": { "type": "integer", @@ -1473,7 +1473,7 @@ "type": "object", "properties": { "__metadata": { - "$ref": "#/definitions/%40OData.metadata" + "$ref": "#/definitions/metadata" }, "ID": { "type": "integer", @@ -1548,7 +1548,7 @@ "type": "object", "properties": { "__metadata": { - "$ref": "#/definitions/%40OData.metadata" + "$ref": "#/definitions/metadata" }, "ID": { "type": "integer", @@ -1763,7 +1763,7 @@ }, "title": "Address (for update)" }, - "@OData.metadata": { + "metadata": { "type": "object", "description": "This name/value pair is not data, but instead, specifies the metadata for the EntityType instance that the JSON object represents.", "properties": { @@ -1775,10 +1775,6 @@ }, "type": { "type": "string" - }, - "etag": { - "type": "string", - "example": "W/\"X'000000000000D2F3'\"" } } }, diff --git a/tools/tests/odata-rw-v3.openapi3.json b/tools/tests/odata-rw-v3.openapi3.json index b1688170..7ce08316 100644 --- a/tools/tests/odata-rw-v3.openapi3.json +++ b/tools/tests/odata-rw-v3.openapi3.json @@ -138,7 +138,7 @@ "title": "Collection of Product", "type": "object", "properties": { - "@count": { + "@odata.count": { "$ref": "#/components/schemas/count" }, "value": { @@ -467,7 +467,7 @@ "title": "Collection of Category", "type": "object", "properties": { - "@count": { + "@odata.count": { "$ref": "#/components/schemas/count" }, "value": { @@ -754,7 +754,7 @@ "title": "Collection of ProductDetail", "type": "object", "properties": { - "@count": { + "@odata.count": { "$ref": "#/components/schemas/count" }, "value": { @@ -1142,7 +1142,7 @@ "title": "Collection of Category", "type": "object", "properties": { - "@count": { + "@odata.count": { "$ref": "#/components/schemas/count" }, "value": { @@ -1421,7 +1421,7 @@ "title": "Collection of Product", "type": "object", "properties": { - "@count": { + "@odata.count": { "$ref": "#/components/schemas/count" }, "value": { @@ -1570,7 +1570,7 @@ "title": "Collection of Supplier", "type": "object", "properties": { - "@count": { + "@odata.count": { "$ref": "#/components/schemas/count" }, "value": { @@ -1852,7 +1852,7 @@ "title": "Collection of Product", "type": "object", "properties": { - "@count": { + "@odata.count": { "$ref": "#/components/schemas/count" }, "value": { @@ -1992,7 +1992,7 @@ "title": "Collection of Person", "type": "object", "properties": { - "@count": { + "@odata.count": { "$ref": "#/components/schemas/count" }, "value": { @@ -2329,7 +2329,7 @@ "title": "Collection of PersonDetail", "type": "object", "properties": { - "@count": { + "@odata.count": { "$ref": "#/components/schemas/count" }, "value": { @@ -2657,7 +2657,7 @@ "title": "Collection of Advertisement", "type": "object", "properties": { - "@count": { + "@odata.count": { "$ref": "#/components/schemas/count" }, "value": { @@ -2903,7 +2903,7 @@ "title": "Collection of Product", "type": "object", "properties": { - "@count": { + "@odata.count": { "$ref": "#/components/schemas/count" }, "value": { @@ -2998,9 +2998,6 @@ "ODataDemo.Product": { "type": "object", "properties": { - "@etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "ID": { "type": "integer", "format": "int32" @@ -3203,11 +3200,8 @@ "ODataDemo.FeaturedProduct": { "type": "object", "properties": { - "@etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, - "@type": { - "$ref": "#/components/schemas/%40OData.type" + "@odata.type": { + "$ref": "#/components/schemas/type" }, "ID": { "type": "integer", @@ -3403,9 +3397,6 @@ "ODataDemo.ProductDetail": { "type": "object", "properties": { - "@etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "ProductID": { "type": "integer", "format": "int32" @@ -3463,9 +3454,6 @@ "ODataDemo.Category": { "type": "object", "properties": { - "@etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "ID": { "type": "integer", "format": "int32" @@ -3519,9 +3507,6 @@ "ODataDemo.Supplier": { "type": "object", "properties": { - "@etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "ID": { "type": "integer", "format": "int32" @@ -3713,9 +3698,6 @@ "ODataDemo.Person": { "type": "object", "properties": { - "@etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "ID": { "type": "integer", "format": "int32" @@ -3806,11 +3788,8 @@ "ODataDemo.Customer": { "type": "object", "properties": { - "@etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, - "@type": { - "$ref": "#/components/schemas/%40OData.type" + "@odata.type": { + "$ref": "#/components/schemas/type" }, "ID": { "type": "integer", @@ -3908,11 +3887,8 @@ "ODataDemo.Employee": { "type": "object", "properties": { - "@etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, - "@type": { - "$ref": "#/components/schemas/%40OData.type" + "@odata.type": { + "$ref": "#/components/schemas/type" }, "ID": { "type": "integer", @@ -4058,9 +4034,6 @@ "ODataDemo.PersonDetail": { "type": "object", "properties": { - "@etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "PersonID": { "type": "integer", "format": "int32" @@ -4175,9 +4148,6 @@ "ODataDemo.Advertisement": { "type": "object", "properties": { - "@etag": { - "$ref": "#/components/schemas/%40OData.etag" - }, "ID": { "type": "string", "format": "uuid", @@ -4249,11 +4219,7 @@ }, "title": "Advertisement (for update)" }, - "@OData.etag": { - "type": "string", - "example": "W/\"08D7D40891852C76\"" - }, - "@OData.type": { + "type": { "type": "string" }, "count": { diff --git a/tools/tests/odata-rw-v3.swagger.json b/tools/tests/odata-rw-v3.swagger.json index 36e3f338..57936e27 100644 --- a/tools/tests/odata-rw-v3.swagger.json +++ b/tools/tests/odata-rw-v3.swagger.json @@ -131,7 +131,7 @@ "title": "Collection of Product", "type": "object", "properties": { - "@count": { + "@odata.count": { "$ref": "#/definitions/count" }, "value": { @@ -413,7 +413,7 @@ "title": "Collection of Category", "type": "object", "properties": { - "@count": { + "@odata.count": { "$ref": "#/definitions/count" }, "value": { @@ -656,7 +656,7 @@ "title": "Collection of ProductDetail", "type": "object", "properties": { - "@count": { + "@odata.count": { "$ref": "#/definitions/count" }, "value": { @@ -987,7 +987,7 @@ "title": "Collection of Category", "type": "object", "properties": { - "@count": { + "@odata.count": { "$ref": "#/definitions/count" }, "value": { @@ -1231,7 +1231,7 @@ "title": "Collection of Product", "type": "object", "properties": { - "@count": { + "@odata.count": { "$ref": "#/definitions/count" }, "value": { @@ -1360,7 +1360,7 @@ "title": "Collection of Supplier", "type": "object", "properties": { - "@count": { + "@odata.count": { "$ref": "#/definitions/count" }, "value": { @@ -1607,7 +1607,7 @@ "title": "Collection of Product", "type": "object", "properties": { - "@count": { + "@odata.count": { "$ref": "#/definitions/count" }, "value": { @@ -1727,7 +1727,7 @@ "title": "Collection of Person", "type": "object", "properties": { - "@count": { + "@odata.count": { "$ref": "#/definitions/count" }, "value": { @@ -2019,7 +2019,7 @@ "title": "Collection of PersonDetail", "type": "object", "properties": { - "@count": { + "@odata.count": { "$ref": "#/definitions/count" }, "value": { @@ -2302,7 +2302,7 @@ "title": "Collection of Advertisement", "type": "object", "properties": { - "@count": { + "@odata.count": { "$ref": "#/definitions/count" }, "value": { @@ -2511,7 +2511,7 @@ "title": "Collection of Product", "type": "object", "properties": { - "@count": { + "@odata.count": { "$ref": "#/definitions/count" }, "value": { @@ -2604,9 +2604,6 @@ "ODataDemo.Product": { "type": "object", "properties": { - "@etag": { - "$ref": "#/definitions/%40OData.etag" - }, "ID": { "type": "integer", "format": "int32" @@ -2777,11 +2774,8 @@ "ODataDemo.FeaturedProduct": { "type": "object", "properties": { - "@etag": { - "$ref": "#/definitions/%40OData.etag" - }, - "@type": { - "$ref": "#/definitions/%40OData.type" + "@odata.type": { + "$ref": "#/definitions/type" }, "ID": { "type": "integer", @@ -2959,9 +2953,6 @@ "ODataDemo.ProductDetail": { "type": "object", "properties": { - "@etag": { - "$ref": "#/definitions/%40OData.etag" - }, "ProductID": { "type": "integer", "format": "int32" @@ -3018,9 +3009,6 @@ "ODataDemo.Category": { "type": "object", "properties": { - "@etag": { - "$ref": "#/definitions/%40OData.etag" - }, "ID": { "type": "integer", "format": "int32" @@ -3083,9 +3071,6 @@ "ODataDemo.Supplier": { "type": "object", "properties": { - "@etag": { - "$ref": "#/definitions/%40OData.etag" - }, "ID": { "type": "integer", "format": "int32" @@ -3301,9 +3286,6 @@ "ODataDemo.Person": { "type": "object", "properties": { - "@etag": { - "$ref": "#/definitions/%40OData.etag" - }, "ID": { "type": "integer", "format": "int32" @@ -3360,11 +3342,8 @@ "ODataDemo.Customer": { "type": "object", "properties": { - "@etag": { - "$ref": "#/definitions/%40OData.etag" - }, - "@type": { - "$ref": "#/definitions/%40OData.type" + "@odata.type": { + "$ref": "#/definitions/type" }, "ID": { "type": "integer", @@ -3449,11 +3428,8 @@ "ODataDemo.Employee": { "type": "object", "properties": { - "@etag": { - "$ref": "#/definitions/%40OData.etag" - }, - "@type": { - "$ref": "#/definitions/%40OData.type" + "@odata.type": { + "$ref": "#/definitions/type" }, "ID": { "type": "integer", @@ -3574,9 +3550,6 @@ "ODataDemo.PersonDetail": { "type": "object", "properties": { - "@etag": { - "$ref": "#/definitions/%40OData.etag" - }, "PersonID": { "type": "integer", "format": "int32" @@ -3675,9 +3648,6 @@ "ODataDemo.Advertisement": { "type": "object", "properties": { - "@etag": { - "$ref": "#/definitions/%40OData.etag" - }, "ID": { "type": "string", "format": "uuid", @@ -3748,11 +3718,7 @@ }, "title": "Advertisement (for update)" }, - "@OData.etag": { - "type": "string", - "example": "W/\"08D7D40891852C76\"" - }, - "@OData.type": { + "type": { "type": "string" }, "count": {