"paths": { "/Products": …, "/Products('{ID}')": …, "/Categories": …, "/Categories({ID})": …, "/Suppliers": …, "/Suppliers('{ID}')": …, "/MainSupplier": …, "/Countries": …, "/Countries('{Code}')": …, "/ProductsByRating(Rating={Rating})": … } Paths for Entity Sets Each entity set is represented as a name/value pair whose name is the service-relative resource path of the entity set prepended with a forward slash, and whose value is a , see [OpenAPI]. : "/Products": … Each entity set that is indexable by key is additionally represented as a name/value pair whose name is the path template for key access, with path parameters for the key values, and whose value is a describing the allowed operations on individual entities of this set. : – "/Products('{ID}')": … : – "/OrderItems(OrderID={OrderID},ItemID={ItemID})": … If the service defines bound actions or functions applicable to the entity set or its entities, these are represented as additional name/value pairs with corresponding path templates for the action/function invocation. : "/LeaveRequests({ID})/OData.Demo.Approval": … Query a Collection of Entities The for the entity set contains the keyword get with an as that describes the capabilities for querying the entity set. The tags array of the – as well as all other described in this section – includes the entity set name. : GET – "/Products": { "get": { "summary": "Get entities from Products", "tags": [ "Products" ],
integer int8 OData-specific format Edm.Single number OpenAPI format with extended meaning string is needed for INF, INF, and NaN Edm.String string maxLength Sequence of UTF-8 characters Edm.TimeOfDay string time format Properties of type Edm.Decimal and Edm.Int64 are represented as JSON strings if the format option IEEE754Compatible=true is specified, so they have to be declared with both number and string. The of properties of type Edm.Decimal are represented with the OpenAPI Specification keyword multipleOf and a value of 10scale. The precision is represented with the maximum and minimum keywords and a value of ±(10precision-scale - 10scale) if the scale facet has a numeric value, and ±(10precision - 1) if the scale is variable). Properties of type Edm.Double and Edm.Single have special values for -INF, INF, and NaN that are represented as JSON strings, so they also have to be declared with both number and string. Services that do not support the special values -INF, INF, and NaN omit the string keyword. The default value of a property is represented with the OpenAPI Specification keyword default. : "BooleanValue":{ "type":"boolean", } : "BinaryValue":{ "type":"string", "format":"base64url", "maxLength":44, "default":"T0RhdGE" } : "IntegerValue":{ "type":"integer", "format":"int32", "default":-128 }
"format":"date", "default":"2012-12-03" } : 7 "DateTimeOffsetValue":{ "type":"string", "format":"date-time", "default":"2012-12-03T07:16:23:00.0000000Z" } : "NullableDateTimeOffsetValue":{ "type":["string","null"], "format":"date-time" } : 12 "DurationValue":{ "type":"string", "format":"duration", "default":"P12DT23H59M59.999999999999S" } : 3 "TimeOfDayValue":{ "type":"string", "format":"time", "default":"07:59:59.999" } : "GuidValue":{ "type":"string", "format":"uuid", "default":"1234567-89ab-cdef-0123-456789abcdef" } : "Int64Value":{ "type":[ "integer", "string" ], "format":"int64", "default":0 } : "ColorEnumValue":{ "$ref":"#/definitions/Model1.Color", "default":"yellow" }, : "GeographyPoint":{
"application/json" ], "tags": [ { "name": "Products" }, { "name": "Categories", "description": "Product Categories" }, { "name": "Suppliers" }, { "name": "MainSupplier", "description": "Primary Supplier" }, { "name": "Countries" } ], "definitions": { "ODataDemo.Product": { "type": "object", "properties": { "ID": { "type": "string" }, "Description": { "type": [ "string", "null" ] }, "ReleaseDate": { "type": [ "string", "null" ], "format": "date" }, "DiscontinuedDate": { "type": [ "string", "null" ], "format": "date" }, "Rating": { "type": [ "integer", "null" ], "format": "int32" }, "Price": { "type": [ "number", "string", "null" ], "format": "decimal", "multipleOf": 1