diff --git a/lib/compile/csdl2openapi.js b/lib/compile/csdl2openapi.js index d5f57ae..fdc087d 100644 --- a/lib/compile/csdl2openapi.js +++ b/lib/compile/csdl2openapi.js @@ -107,7 +107,7 @@ module.exports.csdl2openapi = function ( diagram = /** @type {unknown} */(diagram) !== "false" && !!diagram; // as preProcess below mutates the csdl, copy it before, to avoid side-effects on the caller side csdl = structuredClone(csdl) - csdl.$Version = odataVersion ? odataVersion : '4.01' + csdl.$Version = odataVersion ?? csdl.$Version ?? '4.01' const meta = new CSDLMeta(csdl) serviceRoot = serviceRoot ?? (`${scheme}://${host}${basePath}`); const queryOptionPrefix = csdl.$Version <= '4.01' ? '$' : ''; diff --git a/test/lib/compile/data/TripPin.openapi3.json b/test/lib/compile/data/TripPin.openapi3.json index 90623be..ce0c8eb 100644 --- a/test/lib/compile/data/TripPin.openapi3.json +++ b/test/lib/compile/data/TripPin.openapi3.json @@ -1,4498 +1,4498 @@ { - "openapi": "3.0.2", - "info": { - "title": "TripPin service is a sample service for OData V4.", - "description": "This service is located at [https://services.odata.org/V4/(S(cnbm44wtbc1v5bgrlek5lpcc))/TripPinServiceRW/](https://services.odata.org/V4/%28S%28cnbm44wtbc1v5bgrlek5lpcc%29%29/TripPinServiceRW/)\n\n## Entity Data Model\n![ER Diagram](https://yuml.me/diagram/class/[City],[Location],[Location]++-[City],[Location]^[EventLocation],[Location]^[AirportLocation],[Photo{bg:lightslategray}],[Person{bg:lightslategray}],[Person]++-*[Location],[Person]++-0..1[PersonGender],[Person]-*>[Person],[Person]++-*>[Trip],[Person]-0..1>[Photo],[Airline{bg:lightslategray}],[Airport{bg:lightslategray}],[Airport]++-[AirportLocation],[PlanItem{bg:lightslategray}],[PlanItem]^[PublicTransportation{bg:lightslategray}],[PublicTransportation]^[Flight{bg:lightslategray}],[Flight]->[Airport],[Flight]->[Airport],[Flight]->[Airline],[PlanItem]^[Event{bg:lightslategray}],[Event]++-[EventLocation],[Trip{bg:lightslategray}],[Trip]-*>[Photo],[Trip]++-*>[PlanItem],[ResetDataSource{bg:lawngreen}],[GetNearestAirport{bg:lawngreen}]->[Airport],[Me%20{bg:lawngreen}]++->[Person],[Airports%20{bg:lawngreen}]++-*>[Airport],[Airlines%20{bg:lawngreen}]++-*>[Airline],[People%20{bg:lawngreen}]++-*>[Person],[Photos%20{bg:lawngreen}]++-*>[Photo])\n\n### Legend\n![Legend](https://yuml.me/diagram/plain;dir:TB;scale:60/class/[External.Type{bg:whitesmoke}],[ComplexType],[EntityType{bg:lightslategray}],[EntitySet/Singleton/Operation{bg:lawngreen}])", - "version": "" - }, - "x-sap-api-type": "ODATAV4", - "x-odata-version": "4.01", - "x-sap-shortText": "TripPin service is a sample service for OData V4.", - "servers": [ - { - "url": "https://services.odata.org/V4/(S(cnbm44wtbc1v5bgrlek5lpcc))/TripPinServiceRW" - } - ], - "tags": [ - { - "name": "Airlines" - }, - { - "name": "Airports" - }, - { - "name": "Me" - }, - { - "name": "People" + "openapi": "3.0.2", + "info": { + "title": "TripPin service is a sample service for OData V4.", + "description": "This service is located at [https://services.odata.org/V4/(S(cnbm44wtbc1v5bgrlek5lpcc))/TripPinServiceRW/](https://services.odata.org/V4/%28S%28cnbm44wtbc1v5bgrlek5lpcc%29%29/TripPinServiceRW/)\n\n## Entity Data Model\n![ER Diagram](https://yuml.me/diagram/class/[City],[Location],[Location]++-[City],[Location]^[EventLocation],[Location]^[AirportLocation],[Photo{bg:lightslategray}],[Person{bg:lightslategray}],[Person]++-*[Location],[Person]++-0..1[PersonGender],[Person]-*>[Person],[Person]++-*>[Trip],[Person]-0..1>[Photo],[Airline{bg:lightslategray}],[Airport{bg:lightslategray}],[Airport]++-[AirportLocation],[PlanItem{bg:lightslategray}],[PlanItem]^[PublicTransportation{bg:lightslategray}],[PublicTransportation]^[Flight{bg:lightslategray}],[Flight]->[Airport],[Flight]->[Airport],[Flight]->[Airline],[PlanItem]^[Event{bg:lightslategray}],[Event]++-[EventLocation],[Trip{bg:lightslategray}],[Trip]-*>[Photo],[Trip]++-*>[PlanItem],[ResetDataSource{bg:lawngreen}],[GetNearestAirport{bg:lawngreen}]->[Airport],[Me%20{bg:lawngreen}]++->[Person],[Airports%20{bg:lawngreen}]++-*>[Airport],[Airlines%20{bg:lawngreen}]++-*>[Airline],[People%20{bg:lawngreen}]++-*>[Person],[Photos%20{bg:lawngreen}]++-*>[Photo])\n\n### Legend\n![Legend](https://yuml.me/diagram/plain;dir:TB;scale:60/class/[External.Type{bg:whitesmoke}],[ComplexType],[EntityType{bg:lightslategray}],[EntitySet/Singleton/Operation{bg:lawngreen}])", + "version": "" }, - { - "name": "Photos" - } - ], - "paths": { - "/$batch": { - "post": { - "summary": "Sends a group of requests", - "description": "Group multiple requests into a single request payload, see [Batch Requests](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_BatchRequests).\n\n*Please note that \"Try it out\" is not supported for this request.*", - "tags": [ - "Batch Requests" - ], - "requestBody": { - "required": true, - "description": "Batch request", - "content": { - "multipart/mixed;boundary=request-separator": { - "schema": { - "type": "string" - }, - "example": "--request-separator\nContent-Type: application/http\nContent-Transfer-Encoding: binary\n\nGET Photos HTTP/1.1\nAccept: application/json\n\n\n--request-separator--" - } - } + "x-sap-api-type": "ODATAV4", + "x-odata-version": "4.0", + "x-sap-shortText": "TripPin service is a sample service for OData V4.", + "servers": [ + { + "url": "https://services.odata.org/V4/(S(cnbm44wtbc1v5bgrlek5lpcc))/TripPinServiceRW" + } + ], + "tags": [ + { + "name": "Airlines" }, - "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" - } + { + "name": "Airports" + }, + { + "name": "Me" + }, + { + "name": "People" + }, + { + "name": "Photos" } - } - }, - "/Airlines": { - "get": { - "summary": "Retrieves a list of airlines.", - "tags": [ - "Airlines" - ], - "parameters": [ - { - "$ref": "#/components/parameters/top" - }, - { - "$ref": "#/components/parameters/skip" - }, - { - "$ref": "#/components/parameters/search" - }, - { - "name": "$filter", - "description": "Filter items by property values, see [Filtering](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionfilter)", - "in": "query", - "schema": { - "type": "string" - } - }, - { - "$ref": "#/components/parameters/count" - }, - { - "name": "$orderby", - "description": "Order items by property values, see [Sorting](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionorderby)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "AirlineCode", - "AirlineCode desc", - "Name", - "Name desc" - ] - } - } - }, - { - "name": "$select", - "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "AirlineCode", - "Name" - ] - } - } - } - ], - "responses": { - "200": { - "description": "Retrieved airlines", - "content": { - "application/json": { - "schema": { - "type": "object", - "title": "Collection of Airline", - "properties": { - "@count": { - "$ref": "#/components/schemas/count" - }, - "value": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Airline" - } + ], + "paths": { + "/$batch": { + "post": { + "summary": "Sends a group of requests", + "description": "Group multiple requests into a single request payload, see [Batch Requests](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_BatchRequests).\n\n*Please note that \"Try it out\" is not supported for this request.*", + "tags": [ + "Batch Requests" + ], + "requestBody": { + "required": true, + "description": "Batch request", + "content": { + "multipart/mixed;boundary=request-separator": { + "schema": { + "type": "string" + }, + "example": "--request-separator\nContent-Type: application/http\nContent-Transfer-Encoding: binary\n\nGET Photos 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" } - } } - } } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - }, - "post": { - "summary": "Creates a single airline.", - "tags": [ - "Airlines" - ], - "requestBody": { - "description": "New airline", - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Airline-create" - } - } - } }, - "responses": { - "201": { - "description": "Created airline", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Airline" + "/Airlines": { + "get": { + "summary": "Retrieves a list of airlines.", + "tags": [ + "Airlines" + ], + "parameters": [ + { + "$ref": "#/components/parameters/top" + }, + { + "$ref": "#/components/parameters/skip" + }, + { + "$ref": "#/components/parameters/search" + }, + { + "name": "$filter", + "description": "Filter items by property values, see [Filtering](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionfilter)", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/count" + }, + { + "name": "$orderby", + "description": "Order items by property values, see [Sorting](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionorderby)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "AirlineCode", + "AirlineCode desc", + "Name", + "Name desc" + ] + } + } + }, + { + "name": "$select", + "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "AirlineCode", + "Name" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved airlines", + "content": { + "application/json": { + "schema": { + "type": "object", + "title": "Collection of Airline", + "properties": { + "@odata.count": { + "$ref": "#/components/schemas/count" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Airline" + } + } + } + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } } - } - } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - } - }, - "/Airlines('{AirlineCode}')": { - "parameters": [ - { - "description": "key: AirlineCode", - "in": "path", - "name": "AirlineCode", - "required": true, - "schema": { - "type": "string" - } - } - ], - "get": { - "summary": "Retrieves a single airline.", - "tags": [ - "Airlines" - ], - "parameters": [ - { - "name": "$select", - "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "AirlineCode", - "Name" - ] - } - } - } - ], - "responses": { - "200": { - "description": "Retrieved airline", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Airline" + }, + "post": { + "summary": "Creates a single airline.", + "tags": [ + "Airlines" + ], + "requestBody": { + "description": "New airline", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Airline-create" + } + } + } + }, + "responses": { + "201": { + "description": "Created airline", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Airline" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } } - } } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - }, - "patch": { - "summary": "Changes a single airline.", - "tags": [ - "Airlines" - ], - "requestBody": { - "description": "New property values", - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Airline-update" - } - } - } }, - "responses": { - "204": { - "description": "Success" - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - }, - "delete": { - "summary": "Deletes a single airline.", - "tags": [ - "Airlines" - ], - "responses": { - "204": { - "description": "Success" - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - } - }, - "/Airports": { - "get": { - "summary": "Retrieves a list of airports.", - "tags": [ - "Airports" - ], - "parameters": [ - { - "$ref": "#/components/parameters/top" - }, - { - "$ref": "#/components/parameters/skip" - }, - { - "$ref": "#/components/parameters/search" - }, - { - "name": "$filter", - "description": "Filter items by property values, see [Filtering](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionfilter)", - "in": "query", - "schema": { - "type": "string" - } - }, - { - "$ref": "#/components/parameters/count" - }, - { - "name": "$orderby", - "description": "Order items by property values, see [Sorting](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionorderby)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "IcaoCode", - "IcaoCode desc", - "Name", - "Name desc", - "IataCode", - "IataCode desc", - "Location/Address", - "Location/Address desc", - "Location/City/CountryRegion", - "Location/City/CountryRegion desc", - "Location/City/Name", - "Location/City/Name desc", - "Location/City/Region", - "Location/City/Region desc", - "Location/Loc", - "Location/Loc desc" - ] - } - } - }, - { - "name": "$select", - "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "IcaoCode", - "Name", - "IataCode", - "Location" - ] - } - } - } - ], - "responses": { - "200": { - "description": "Retrieved airports", - "content": { - "application/json": { - "schema": { - "type": "object", - "title": "Collection of Airport", - "properties": { - "@count": { - "$ref": "#/components/schemas/count" - }, - "value": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Airport" - } + "/Airlines('{AirlineCode}')": { + "parameters": [ + { + "description": "key: AirlineCode", + "in": "path", + "name": "AirlineCode", + "required": true, + "schema": { + "type": "string" } - } } - } - } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - } - }, - "/Airports('{IcaoCode}')": { - "parameters": [ - { - "description": "key: IcaoCode", - "in": "path", - "name": "IcaoCode", - "required": true, - "schema": { - "type": "string" - } - } - ], - "get": { - "summary": "Retrieves a single airport.", - "tags": [ - "Airports" - ], - "parameters": [ - { - "name": "$select", - "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "IcaoCode", - "Name", - "IataCode", - "Location" - ] - } - } - } - ], - "responses": { - "200": { - "description": "Retrieved airport", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Airport" + ], + "get": { + "summary": "Retrieves a single airline.", + "tags": [ + "Airlines" + ], + "parameters": [ + { + "name": "$select", + "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "AirlineCode", + "Name" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved airline", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Airline" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "patch": { + "summary": "Changes a single airline.", + "tags": [ + "Airlines" + ], + "requestBody": { + "description": "New property values", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Airline-update" + } + } + } + }, + "responses": { + "204": { + "description": "Success" + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "delete": { + "summary": "Deletes a single airline.", + "tags": [ + "Airlines" + ], + "responses": { + "204": { + "description": "Success" + }, + "4XX": { + "$ref": "#/components/responses/error" + } } - } - } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - }, - "patch": { - "summary": "Changes a single airport.", - "tags": [ - "Airports" - ], - "requestBody": { - "description": "New property values", - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Airport-update" - } } - } }, - "responses": { - "204": { - "description": "Success" - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - } - }, - "/GetNearestAirport": { - "get": { - "summary": "Invokes function GetNearestAirport", - "tags": [ - "Airports" - ], - "parameters": [ - { - "required": true, - "in": "query", - "name": "lat", - "schema": { - "anyOf": [ - { - "type": "number", - "format": "double" - }, - { - "type": "string" + "/Airports": { + "get": { + "summary": "Retrieves a list of airports.", + "tags": [ + "Airports" + ], + "parameters": [ + { + "$ref": "#/components/parameters/top" + }, + { + "$ref": "#/components/parameters/skip" + }, + { + "$ref": "#/components/parameters/search" + }, + { + "name": "$filter", + "description": "Filter items by property values, see [Filtering](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionfilter)", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/count" + }, + { + "name": "$orderby", + "description": "Order items by property values, see [Sorting](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionorderby)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "IcaoCode", + "IcaoCode desc", + "Name", + "Name desc", + "IataCode", + "IataCode desc", + "Location/Address", + "Location/Address desc", + "Location/City/CountryRegion", + "Location/City/CountryRegion desc", + "Location/City/Name", + "Location/City/Name desc", + "Location/City/Region", + "Location/City/Region desc", + "Location/Loc", + "Location/Loc desc" + ] + } + } + }, + { + "name": "$select", + "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "IcaoCode", + "Name", + "IataCode", + "Location" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved airports", + "content": { + "application/json": { + "schema": { + "type": "object", + "title": "Collection of Airport", + "properties": { + "@odata.count": { + "$ref": "#/components/schemas/count" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Airport" + } + } + } + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } } - ], - "example": 3.14 } - }, - { - "required": true, - "in": "query", - "name": "lon", - "schema": { - "anyOf": [ + }, + "/Airports('{IcaoCode}')": { + "parameters": [ { - "type": "number", - "format": "double" + "description": "key: IcaoCode", + "in": "path", + "name": "IcaoCode", + "required": true, + "schema": { + "type": "string" + } + } + ], + "get": { + "summary": "Retrieves a single airport.", + "tags": [ + "Airports" + ], + "parameters": [ + { + "name": "$select", + "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "IcaoCode", + "Name", + "IataCode", + "Location" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved airport", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Airport" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "patch": { + "summary": "Changes a single airport.", + "tags": [ + "Airports" + ], + "requestBody": { + "description": "New property values", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Airport-update" + } + } + } }, - { - "type": "string" + "responses": { + "204": { + "description": "Success" + }, + "4XX": { + "$ref": "#/components/responses/error" + } } - ], - "example": 3.14 } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Airport" + }, + "/GetNearestAirport(lat={lat},lon={lon})": { + "get": { + "summary": "Invokes function GetNearestAirport", + "tags": [ + "Airports" + ], + "parameters": [ + { + "required": true, + "in": "path", + "name": "lat", + "schema": { + "anyOf": [ + { + "type": "number", + "format": "double" + }, + { + "type": "string" + } + ], + "example": 3.14 + } + }, + { + "required": true, + "in": "path", + "name": "lon", + "schema": { + "anyOf": [ + { + "type": "number", + "format": "double" + }, + { + "type": "string" + } + ], + "example": 3.14 + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Airport" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } } - } - } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - } - }, - "/Me": { - "get": { - "summary": "Retrieves me.", - "tags": [ - "Me" - ], - "parameters": [ - { - "name": "$select", - "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "UserName", - "FirstName", - "LastName", - "Emails", - "AddressInfo", - "Gender", - "Concurrency" - ] - } - } - }, - { - "name": "$expand", - "description": "The value of $expand query option is a comma-separated list of navigation property names, stream property names, or $value indicating the stream content of a media-entity. The corresponding related entities and stream values will be represented inline, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "*", - "Friends", - "Trips", - "Photo" - ] - } } - } - ], - "responses": { - "200": { - "description": "Retrieved me", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Person" + }, + "/Me": { + "get": { + "summary": "Retrieves me.", + "tags": [ + "Me" + ], + "parameters": [ + { + "name": "$select", + "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "UserName", + "FirstName", + "LastName", + "Emails", + "AddressInfo", + "Gender", + "Concurrency" + ] + } + } + }, + { + "name": "$expand", + "description": "The value of $expand query option is a comma-separated list of navigation property names, stream property names, or $value indicating the stream content of a media-entity. The corresponding related entities and stream values will be represented inline, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Friends", + "Trips", + "Photo" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved me", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Person" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "patch": { + "summary": "Changes me.", + "tags": [ + "Me" + ], + "requestBody": { + "description": "New property values", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Person-update" + } + } + } + }, + "responses": { + "204": { + "description": "Success" + }, + "4XX": { + "$ref": "#/components/responses/error" + } } - } - } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - }, - "patch": { - "summary": "Changes me.", - "tags": [ - "Me" - ], - "requestBody": { - "description": "New property values", - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Person-update" - } } - } }, - "responses": { - "204": { - "description": "Success" - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - } - }, - "/Me/Friends": { - "get": { - "summary": "Retrieves a list of friends of me.", - "tags": [ - "Me", - "People" - ], - "parameters": [ - { - "$ref": "#/components/parameters/top" - }, - { - "$ref": "#/components/parameters/skip" - }, - { - "$ref": "#/components/parameters/search" - }, - { - "name": "$filter", - "description": "Filter items by property values, see [Filtering](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionfilter)", - "in": "query", - "schema": { - "type": "string" - } - }, - { - "$ref": "#/components/parameters/count" - }, - { - "name": "$orderby", - "description": "Order items by property values, see [Sorting](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionorderby)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "UserName", - "UserName desc", - "FirstName", - "FirstName desc", - "LastName", - "LastName desc", - "Emails", - "Emails desc", - "AddressInfo/Address", - "AddressInfo/Address desc", - "AddressInfo/City/CountryRegion", - "AddressInfo/City/CountryRegion desc", - "AddressInfo/City/Name", - "AddressInfo/City/Name desc", - "AddressInfo/City/Region", - "AddressInfo/City/Region desc", - "Gender", - "Gender desc", - "Concurrency", - "Concurrency desc" - ] - } - } - }, - { - "name": "$select", - "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "UserName", - "FirstName", - "LastName", - "Emails", - "AddressInfo", - "Gender", - "Concurrency" - ] - } - } - }, - { - "name": "$expand", - "description": "The value of $expand query option is a comma-separated list of navigation property names, stream property names, or $value indicating the stream content of a media-entity. The corresponding related entities and stream values will be represented inline, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "*", - "Friends", - "Trips", - "Photo" - ] - } - } - } - ], - "responses": { - "200": { - "description": "Retrieved friends", - "content": { - "application/json": { - "schema": { - "type": "object", - "title": "Collection of Person", - "properties": { - "@count": { - "$ref": "#/components/schemas/count" - }, - "value": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Person" - } - } - } + "/Me/Friends": { + "get": { + "summary": "Retrieves a list of friends of me.", + "tags": [ + "Me", + "People" + ], + "parameters": [ + { + "$ref": "#/components/parameters/top" + }, + { + "$ref": "#/components/parameters/skip" + }, + { + "$ref": "#/components/parameters/search" + }, + { + "name": "$filter", + "description": "Filter items by property values, see [Filtering](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionfilter)", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/count" + }, + { + "name": "$orderby", + "description": "Order items by property values, see [Sorting](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionorderby)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "UserName", + "UserName desc", + "FirstName", + "FirstName desc", + "LastName", + "LastName desc", + "Emails", + "Emails desc", + "AddressInfo/Address", + "AddressInfo/Address desc", + "AddressInfo/City/CountryRegion", + "AddressInfo/City/CountryRegion desc", + "AddressInfo/City/Name", + "AddressInfo/City/Name desc", + "AddressInfo/City/Region", + "AddressInfo/City/Region desc", + "Gender", + "Gender desc", + "Concurrency", + "Concurrency desc" + ] + } + } + }, + { + "name": "$select", + "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "UserName", + "FirstName", + "LastName", + "Emails", + "AddressInfo", + "Gender", + "Concurrency" + ] + } + } + }, + { + "name": "$expand", + "description": "The value of $expand query option is a comma-separated list of navigation property names, stream property names, or $value indicating the stream content of a media-entity. The corresponding related entities and stream values will be represented inline, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Friends", + "Trips", + "Photo" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved friends", + "content": { + "application/json": { + "schema": { + "type": "object", + "title": "Collection of Person", + "properties": { + "@odata.count": { + "$ref": "#/components/schemas/count" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Person" + } + } + } + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "post": { + "summary": "Creates a single friend of me.", + "tags": [ + "Me", + "People" + ], + "requestBody": { + "description": "New friend", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Person-create" + } + } + } + }, + "responses": { + "201": { + "description": "Created friend", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Person" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } } - } - } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - }, - "post": { - "summary": "Creates a single friend of me.", - "tags": [ - "Me", - "People" - ], - "requestBody": { - "description": "New friend", - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Person-create" - } } - } }, - "responses": { - "201": { - "description": "Created friend", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Person" + "/Me/Microsoft.OData.SampleService.Models.TripPin.GetFavoriteAirline()": { + "get": { + "summary": "Invokes function GetFavoriteAirline", + "tags": [ + "Me" + ], + "parameters": [], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Airline" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } } - } } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - } - }, - "/Me/Microsoft.OData.SampleService.Models.TripPin.GetFavoriteAirline": { - "get": { - "summary": "Invokes function GetFavoriteAirline", - "tags": [ - "Me" - ], - "parameters": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Airline" + }, + "/Me/Microsoft.OData.SampleService.Models.TripPin.GetFriendsTrips(userName={userName})": { + "get": { + "summary": "Invokes function GetFriendsTrips", + "tags": [ + "Me" + ], + "parameters": [ + { + "required": true, + "in": "path", + "name": "userName", + "description": "String value needs to be enclosed in single quotes", + "schema": { + "type": "string", + "pattern": "^'([^']|'')*'$" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "object", + "title": "Collection of Trip", + "properties": { + "@odata.count": { + "$ref": "#/components/schemas/count" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Trip" + } + } + } + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } } - } - } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - } - }, - "/Me/Microsoft.OData.SampleService.Models.TripPin.GetFriendsTrips": { - "get": { - "summary": "Invokes function GetFriendsTrips", - "tags": [ - "Me" - ], - "parameters": [ - { - "required": true, - "in": "query", - "name": "userName", - "description": "String value needs to be enclosed in single quotes", - "schema": { - "type": "string", - "pattern": "^'([^']|'')*'$" } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "title": "Collection of Trip", - "properties": { - "@count": { - "$ref": "#/components/schemas/count" - }, - "value": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Trip" - } - } - } + }, + "/Me/Microsoft.OData.SampleService.Models.TripPin.ShareTrip": { + "post": { + "summary": "Invokes action ShareTrip", + "tags": [ + "Me" + ], + "responses": { + "204": { + "description": "Success" + }, + "4XX": { + "$ref": "#/components/responses/error" + } + }, + "requestBody": { + "description": "Action parameters", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "userName": { + "type": "string" + }, + "tripId": { + "type": "integer", + "format": "int32" + } + } + } + } + } } - } } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - } - }, - "/Me/Microsoft.OData.SampleService.Models.TripPin.ShareTrip": { - "post": { - "summary": "Invokes action ShareTrip", - "tags": [ - "Me" - ], - "responses": { - "204": { - "description": "Success" - }, - "4XX": { - "$ref": "#/components/responses/error" - } }, - "requestBody": { - "description": "Action parameters", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "userName": { - "type": "string" - }, - "tripId": { - "type": "integer", - "format": "int32" - } + "/Me/Photo": { + "get": { + "summary": "Retrieves photo of me.", + "tags": [ + "Me", + "Photos" + ], + "parameters": [ + { + "name": "$select", + "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "Id", + "Name" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved photo", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Photo" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } } - } - } - } - } - } - }, - "/Me/Photo": { - "get": { - "summary": "Retrieves photo of me.", - "tags": [ - "Me", - "Photos" - ], - "parameters": [ - { - "name": "$select", - "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "Id", - "Name" - ] - } } - } - ], - "responses": { - "200": { - "description": "Retrieved photo", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Photo" + }, + "/Me/Trips": { + "get": { + "summary": "Retrieves a list of trips of me.", + "tags": [ + "Me" + ], + "parameters": [ + { + "$ref": "#/components/parameters/top" + }, + { + "$ref": "#/components/parameters/skip" + }, + { + "$ref": "#/components/parameters/search" + }, + { + "name": "$filter", + "description": "Filter items by property values, see [Filtering](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionfilter)", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/count" + }, + { + "name": "$orderby", + "description": "Order items by property values, see [Sorting](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionorderby)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "TripId", + "TripId desc", + "ShareId", + "ShareId desc", + "Description", + "Description desc", + "Name", + "Name desc", + "Budget", + "Budget desc", + "StartsAt", + "StartsAt desc", + "EndsAt", + "EndsAt desc", + "Tags", + "Tags desc" + ] + } + } + }, + { + "name": "$select", + "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "TripId", + "ShareId", + "Description", + "Name", + "Budget", + "StartsAt", + "EndsAt", + "Tags" + ] + } + } + }, + { + "name": "$expand", + "description": "The value of $expand query option is a comma-separated list of navigation property names, stream property names, or $value indicating the stream content of a media-entity. The corresponding related entities and stream values will be represented inline, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Photos", + "PlanItems" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved trips", + "content": { + "application/json": { + "schema": { + "type": "object", + "title": "Collection of Trip", + "properties": { + "@odata.count": { + "$ref": "#/components/schemas/count" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Trip" + } + } + } + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } } - } - } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - } - }, - "/Me/Trips": { - "get": { - "summary": "Retrieves a list of trips of me.", - "tags": [ - "Me" - ], - "parameters": [ - { - "$ref": "#/components/parameters/top" - }, - { - "$ref": "#/components/parameters/skip" - }, - { - "$ref": "#/components/parameters/search" - }, - { - "name": "$filter", - "description": "Filter items by property values, see [Filtering](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionfilter)", - "in": "query", - "schema": { - "type": "string" - } - }, - { - "$ref": "#/components/parameters/count" - }, - { - "name": "$orderby", - "description": "Order items by property values, see [Sorting](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionorderby)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "TripId", - "TripId desc", - "ShareId", - "ShareId desc", - "Description", - "Description desc", - "Name", - "Name desc", - "Budget", - "Budget desc", - "StartsAt", - "StartsAt desc", - "EndsAt", - "EndsAt desc", - "Tags", - "Tags desc" - ] - } - } - }, - { - "name": "$select", - "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "TripId", - "ShareId", - "Description", - "Name", - "Budget", - "StartsAt", - "EndsAt", - "Tags" - ] - } - } - }, - { - "name": "$expand", - "description": "The value of $expand query option is a comma-separated list of navigation property names, stream property names, or $value indicating the stream content of a media-entity. The corresponding related entities and stream values will be represented inline, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "*", - "Photos", - "PlanItems" - ] - } - } - } - ], - "responses": { - "200": { - "description": "Retrieved trips", - "content": { - "application/json": { - "schema": { - "type": "object", - "title": "Collection of Trip", - "properties": { - "@count": { - "$ref": "#/components/schemas/count" - }, - "value": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Trip" - } - } - } + }, + "post": { + "summary": "Creates a single trip of me.", + "tags": [ + "Me" + ], + "requestBody": { + "description": "New trip", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Trip-create" + } + } + } + }, + "responses": { + "201": { + "description": "Created trip", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Trip" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } } - } - } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - }, - "post": { - "summary": "Creates a single trip of me.", - "tags": [ - "Me" - ], - "requestBody": { - "description": "New trip", - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Trip-create" - } } - } }, - "responses": { - "201": { - "description": "Created trip", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Trip" + "/Me/Trips({TripId_1})": { + "parameters": [ + { + "description": "key: TripId", + "in": "path", + "name": "TripId_1", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } } - } - } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - } - }, - "/Me/Trips({TripId_1})": { - "parameters": [ - { - "description": "key: TripId", - "in": "path", - "name": "TripId_1", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - } - ], - "get": { - "summary": "Retrieves a single trip of me.", - "tags": [ - "Me" - ], - "parameters": [ - { - "name": "$select", - "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "TripId", - "ShareId", - "Description", - "Name", - "Budget", - "StartsAt", - "EndsAt", - "Tags" - ] - } - } - }, - { - "name": "$expand", - "description": "The value of $expand query option is a comma-separated list of navigation property names, stream property names, or $value indicating the stream content of a media-entity. The corresponding related entities and stream values will be represented inline, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "*", - "Photos", - "PlanItems" - ] - } - } - } - ], - "responses": { - "200": { - "description": "Retrieved trip", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Trip" + ], + "get": { + "summary": "Retrieves a single trip of me.", + "tags": [ + "Me" + ], + "parameters": [ + { + "name": "$select", + "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "TripId", + "ShareId", + "Description", + "Name", + "Budget", + "StartsAt", + "EndsAt", + "Tags" + ] + } + } + }, + { + "name": "$expand", + "description": "The value of $expand query option is a comma-separated list of navigation property names, stream property names, or $value indicating the stream content of a media-entity. The corresponding related entities and stream values will be represented inline, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Photos", + "PlanItems" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved trip", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Trip" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "patch": { + "summary": "Changes a single trip of me.", + "tags": [ + "Me" + ], + "requestBody": { + "description": "New property values", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Trip-update" + } + } + } + }, + "responses": { + "204": { + "description": "Success" + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "delete": { + "summary": "Deletes a single trip of me.", + "tags": [ + "Me" + ], + "responses": { + "204": { + "description": "Success" + }, + "4XX": { + "$ref": "#/components/responses/error" + } } - } - } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - }, - "patch": { - "summary": "Changes a single trip of me.", - "tags": [ - "Me" - ], - "requestBody": { - "description": "New property values", - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Trip-update" - } } - } }, - "responses": { - "204": { - "description": "Success" - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - }, - "delete": { - "summary": "Deletes a single trip of me.", - "tags": [ - "Me" - ], - "responses": { - "204": { - "description": "Success" - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - } - }, - "/Me/Trips({TripId_1})/Microsoft.OData.SampleService.Models.TripPin.GetInvolvedPeople": { - "get": { - "summary": "Invokes function GetInvolvedPeople", - "tags": [ - "Me" - ], - "parameters": [ - { - "description": "key: TripId", - "in": "path", - "name": "TripId_1", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "title": "Collection of Person", - "properties": { - "@count": { - "$ref": "#/components/schemas/count" - }, - "value": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Person" - } - } - } + "/Me/Trips({TripId_1})/Microsoft.OData.SampleService.Models.TripPin.GetInvolvedPeople()": { + "get": { + "summary": "Invokes function GetInvolvedPeople", + "tags": [ + "Me" + ], + "parameters": [ + { + "description": "key: TripId", + "in": "path", + "name": "TripId_1", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "object", + "title": "Collection of Person", + "properties": { + "@odata.count": { + "$ref": "#/components/schemas/count" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Person" + } + } + } + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } } - } - } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - } - }, - "/Me/Trips({TripId_1})/Photos": { - "parameters": [ - { - "description": "key: TripId", - "in": "path", - "name": "TripId_1", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - } - ], - "get": { - "summary": "Retrieves a list of photos of a me.", - "tags": [ - "Me" - ], - "parameters": [ - { - "$ref": "#/components/parameters/top" - }, - { - "$ref": "#/components/parameters/skip" - }, - { - "$ref": "#/components/parameters/search" - }, - { - "name": "$filter", - "description": "Filter items by property values, see [Filtering](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionfilter)", - "in": "query", - "schema": { - "type": "string" - } - }, - { - "$ref": "#/components/parameters/count" - }, - { - "name": "$orderby", - "description": "Order items by property values, see [Sorting](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionorderby)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "Id", - "Id desc", - "Name", - "Name desc" - ] - } - } - }, - { - "name": "$select", - "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "Id", - "Name" - ] - } } - } - ], - "responses": { - "200": { - "description": "Retrieved photos", - "content": { - "application/json": { - "schema": { - "type": "object", - "title": "Collection of Photo", - "properties": { - "@count": { - "$ref": "#/components/schemas/count" - }, - "value": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Photo" - } - } - } + }, + "/Me/Trips({TripId_1})/Photos": { + "parameters": [ + { + "description": "key: TripId", + "in": "path", + "name": "TripId_1", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } } - } - } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - } - }, - "/Me/Trips({TripId_1})/PlanItems": { - "parameters": [ - { - "description": "key: TripId", - "in": "path", - "name": "TripId_1", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - } - ], - "get": { - "summary": "Retrieves a list of plan items of a me.", - "tags": [ - "Me" - ], - "parameters": [ - { - "$ref": "#/components/parameters/top" - }, - { - "$ref": "#/components/parameters/skip" - }, - { - "$ref": "#/components/parameters/search" - }, - { - "name": "$filter", - "description": "Filter items by property values, see [Filtering](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionfilter)", - "in": "query", - "schema": { - "type": "string" - } - }, - { - "$ref": "#/components/parameters/count" - }, - { - "name": "$orderby", - "description": "Order items by property values, see [Sorting](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionorderby)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "PlanItemId", - "PlanItemId desc", - "ConfirmationCode", - "ConfirmationCode desc", - "StartsAt", - "StartsAt desc", - "EndsAt", - "EndsAt desc", - "Duration", - "Duration desc" - ] - } - } - }, - { - "name": "$select", - "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "PlanItemId", - "ConfirmationCode", - "StartsAt", - "EndsAt", - "Duration" - ] - } - } - } - ], - "responses": { - "200": { - "description": "Retrieved plan items", - "content": { - "application/json": { - "schema": { - "type": "object", - "title": "Collection of PlanItem", - "properties": { - "@count": { - "$ref": "#/components/schemas/count" - }, - "value": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.PlanItem" - } - } - } + ], + "get": { + "summary": "Retrieves a list of photos of a me.", + "tags": [ + "Me" + ], + "parameters": [ + { + "$ref": "#/components/parameters/top" + }, + { + "$ref": "#/components/parameters/skip" + }, + { + "$ref": "#/components/parameters/search" + }, + { + "name": "$filter", + "description": "Filter items by property values, see [Filtering](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionfilter)", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/count" + }, + { + "name": "$orderby", + "description": "Order items by property values, see [Sorting](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionorderby)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "Id", + "Id desc", + "Name", + "Name desc" + ] + } + } + }, + { + "name": "$select", + "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "Id", + "Name" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved photos", + "content": { + "application/json": { + "schema": { + "type": "object", + "title": "Collection of Photo", + "properties": { + "@odata.count": { + "$ref": "#/components/schemas/count" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Photo" + } + } + } + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } } - } - } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - }, - "post": { - "summary": "Creates a single plan item of a me.", - "tags": [ - "Me" - ], - "requestBody": { - "description": "New plan item", - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.PlanItem-create" - } } - } }, - "responses": { - "201": { - "description": "Created plan item", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.PlanItem" + "/Me/Trips({TripId_1})/PlanItems": { + "parameters": [ + { + "description": "key: TripId", + "in": "path", + "name": "TripId_1", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "get": { + "summary": "Retrieves a list of plan items of a me.", + "tags": [ + "Me" + ], + "parameters": [ + { + "$ref": "#/components/parameters/top" + }, + { + "$ref": "#/components/parameters/skip" + }, + { + "$ref": "#/components/parameters/search" + }, + { + "name": "$filter", + "description": "Filter items by property values, see [Filtering](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionfilter)", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/count" + }, + { + "name": "$orderby", + "description": "Order items by property values, see [Sorting](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionorderby)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "PlanItemId", + "PlanItemId desc", + "ConfirmationCode", + "ConfirmationCode desc", + "StartsAt", + "StartsAt desc", + "EndsAt", + "EndsAt desc", + "Duration", + "Duration desc" + ] + } + } + }, + { + "name": "$select", + "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "PlanItemId", + "ConfirmationCode", + "StartsAt", + "EndsAt", + "Duration" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved plan items", + "content": { + "application/json": { + "schema": { + "type": "object", + "title": "Collection of PlanItem", + "properties": { + "@odata.count": { + "$ref": "#/components/schemas/count" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.PlanItem" + } + } + } + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "post": { + "summary": "Creates a single plan item of a me.", + "tags": [ + "Me" + ], + "requestBody": { + "description": "New plan item", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.PlanItem-create" + } + } + } + }, + "responses": { + "201": { + "description": "Created plan item", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.PlanItem" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } } - } } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - } - }, - "/Me/Trips({TripId_1})/PlanItems({PlanItemId_2})": { - "parameters": [ - { - "description": "key: TripId", - "in": "path", - "name": "TripId_1", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } }, - { - "description": "key: PlanItemId", - "in": "path", - "name": "PlanItemId_2", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - } - ], - "get": { - "summary": "Retrieves a single plan item of a me.", - "tags": [ - "Me" - ], - "parameters": [ - { - "name": "$select", - "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "PlanItemId", - "ConfirmationCode", - "StartsAt", - "EndsAt", - "Duration" - ] - } - } - } - ], - "responses": { - "200": { - "description": "Retrieved plan item", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.PlanItem" + "/Me/Trips({TripId_1})/PlanItems({PlanItemId_2})": { + "parameters": [ + { + "description": "key: TripId", + "in": "path", + "name": "TripId_1", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "description": "key: PlanItemId", + "in": "path", + "name": "PlanItemId_2", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "get": { + "summary": "Retrieves a single plan item of a me.", + "tags": [ + "Me" + ], + "parameters": [ + { + "name": "$select", + "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "PlanItemId", + "ConfirmationCode", + "StartsAt", + "EndsAt", + "Duration" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved plan item", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.PlanItem" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "patch": { + "summary": "Changes a single plan item of a me.", + "tags": [ + "Me" + ], + "requestBody": { + "description": "New property values", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.PlanItem-update" + } + } + } + }, + "responses": { + "204": { + "description": "Success" + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "delete": { + "summary": "Deletes a single plan item of a me.", + "tags": [ + "Me" + ], + "responses": { + "204": { + "description": "Success" + }, + "4XX": { + "$ref": "#/components/responses/error" + } } - } - } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - }, - "patch": { - "summary": "Changes a single plan item of a me.", - "tags": [ - "Me" - ], - "requestBody": { - "description": "New property values", - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.PlanItem-update" - } } - } }, - "responses": { - "204": { - "description": "Success" - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - }, - "delete": { - "summary": "Deletes a single plan item of a me.", - "tags": [ - "Me" - ], - "responses": { - "204": { - "description": "Success" - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - } - }, - "/People": { - "get": { - "summary": "Retrieves a list of people.", - "tags": [ - "People" - ], - "parameters": [ - { - "$ref": "#/components/parameters/top" - }, - { - "$ref": "#/components/parameters/skip" - }, - { - "$ref": "#/components/parameters/search" - }, - { - "name": "$filter", - "description": "Filter items by property values, see [Filtering](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionfilter)", - "in": "query", - "schema": { - "type": "string" - } - }, - { - "$ref": "#/components/parameters/count" - }, - { - "name": "$orderby", - "description": "Order items by property values, see [Sorting](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionorderby)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "UserName", - "UserName desc", - "FirstName", - "FirstName desc", - "LastName", - "LastName desc", - "Emails", - "Emails desc", - "AddressInfo/Address", - "AddressInfo/Address desc", - "AddressInfo/City/CountryRegion", - "AddressInfo/City/CountryRegion desc", - "AddressInfo/City/Name", - "AddressInfo/City/Name desc", - "AddressInfo/City/Region", - "AddressInfo/City/Region desc", - "Gender", - "Gender desc", - "Concurrency", - "Concurrency desc" - ] - } + "/People": { + "get": { + "summary": "Retrieves a list of people.", + "tags": [ + "People" + ], + "parameters": [ + { + "$ref": "#/components/parameters/top" + }, + { + "$ref": "#/components/parameters/skip" + }, + { + "$ref": "#/components/parameters/search" + }, + { + "name": "$filter", + "description": "Filter items by property values, see [Filtering](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionfilter)", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/count" + }, + { + "name": "$orderby", + "description": "Order items by property values, see [Sorting](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionorderby)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "UserName", + "UserName desc", + "FirstName", + "FirstName desc", + "LastName", + "LastName desc", + "Emails", + "Emails desc", + "AddressInfo/Address", + "AddressInfo/Address desc", + "AddressInfo/City/CountryRegion", + "AddressInfo/City/CountryRegion desc", + "AddressInfo/City/Name", + "AddressInfo/City/Name desc", + "AddressInfo/City/Region", + "AddressInfo/City/Region desc", + "Gender", + "Gender desc", + "Concurrency", + "Concurrency desc" + ] + } + } + }, + { + "name": "$select", + "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "UserName", + "FirstName", + "LastName", + "Emails", + "AddressInfo", + "Gender", + "Concurrency" + ] + } + } + }, + { + "name": "$expand", + "description": "The value of $expand query option is a comma-separated list of navigation property names, stream property names, or $value indicating the stream content of a media-entity. The corresponding related entities and stream values will be represented inline, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Friends", + "Trips", + "Photo" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved people", + "content": { + "application/json": { + "schema": { + "type": "object", + "title": "Collection of Person", + "properties": { + "@odata.count": { + "$ref": "#/components/schemas/count" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Person" + } + } + } + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "post": { + "summary": "Creates a single person.", + "tags": [ + "People" + ], + "requestBody": { + "description": "New person", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Person-create" + } + } + } + }, + "responses": { + "201": { + "description": "Created person", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Person" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } } - }, - { - "name": "$select", - "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "UserName", - "FirstName", - "LastName", - "Emails", - "AddressInfo", - "Gender", - "Concurrency" - ] - } + }, + "/People('{UserName}')": { + "parameters": [ + { + "description": "key: UserName", + "in": "path", + "name": "UserName", + "required": true, + "schema": { + "type": "string" + } + } + ], + "get": { + "summary": "Retrieves a single person.", + "tags": [ + "People" + ], + "parameters": [ + { + "name": "$select", + "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "UserName", + "FirstName", + "LastName", + "Emails", + "AddressInfo", + "Gender", + "Concurrency" + ] + } + } + }, + { + "name": "$expand", + "description": "The value of $expand query option is a comma-separated list of navigation property names, stream property names, or $value indicating the stream content of a media-entity. The corresponding related entities and stream values will be represented inline, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Friends", + "Trips", + "Photo" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved person", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Person" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "patch": { + "summary": "Changes a single person.", + "tags": [ + "People" + ], + "requestBody": { + "description": "New property values", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Person-update" + } + } + } + }, + "responses": { + "204": { + "description": "Success" + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "delete": { + "summary": "Deletes a single person.", + "tags": [ + "People" + ], + "responses": { + "204": { + "description": "Success" + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } } - }, - { - "name": "$expand", - "description": "The value of $expand query option is a comma-separated list of navigation property names, stream property names, or $value indicating the stream content of a media-entity. The corresponding related entities and stream values will be represented inline, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "*", - "Friends", - "Trips", - "Photo" - ] - } + }, + "/People('{UserName}')/Friends": { + "parameters": [ + { + "description": "key: UserName", + "in": "path", + "name": "UserName", + "required": true, + "schema": { + "type": "string" + } + } + ], + "get": { + "summary": "Retrieves a list of friends of a person.", + "tags": [ + "People" + ], + "parameters": [ + { + "$ref": "#/components/parameters/top" + }, + { + "$ref": "#/components/parameters/skip" + }, + { + "$ref": "#/components/parameters/search" + }, + { + "name": "$filter", + "description": "Filter items by property values, see [Filtering](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionfilter)", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/count" + }, + { + "name": "$orderby", + "description": "Order items by property values, see [Sorting](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionorderby)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "UserName", + "UserName desc", + "FirstName", + "FirstName desc", + "LastName", + "LastName desc", + "Emails", + "Emails desc", + "AddressInfo/Address", + "AddressInfo/Address desc", + "AddressInfo/City/CountryRegion", + "AddressInfo/City/CountryRegion desc", + "AddressInfo/City/Name", + "AddressInfo/City/Name desc", + "AddressInfo/City/Region", + "AddressInfo/City/Region desc", + "Gender", + "Gender desc", + "Concurrency", + "Concurrency desc" + ] + } + } + }, + { + "name": "$select", + "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "UserName", + "FirstName", + "LastName", + "Emails", + "AddressInfo", + "Gender", + "Concurrency" + ] + } + } + }, + { + "name": "$expand", + "description": "The value of $expand query option is a comma-separated list of navigation property names, stream property names, or $value indicating the stream content of a media-entity. The corresponding related entities and stream values will be represented inline, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Friends", + "Trips", + "Photo" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved friends", + "content": { + "application/json": { + "schema": { + "type": "object", + "title": "Collection of Person", + "properties": { + "@odata.count": { + "$ref": "#/components/schemas/count" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Person" + } + } + } + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "post": { + "summary": "Creates a single friend of a person.", + "tags": [ + "People" + ], + "requestBody": { + "description": "New friend", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Person-create" + } + } + } + }, + "responses": { + "201": { + "description": "Created friend", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Person" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } } - } - ], - "responses": { - "200": { - "description": "Retrieved people", - "content": { - "application/json": { - "schema": { - "type": "object", - "title": "Collection of Person", - "properties": { - "@count": { - "$ref": "#/components/schemas/count" - }, - "value": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Person" - } - } - } + }, + "/People('{UserName}')/Microsoft.OData.SampleService.Models.TripPin.GetFavoriteAirline()": { + "get": { + "summary": "Invokes function GetFavoriteAirline", + "tags": [ + "People" + ], + "parameters": [ + { + "description": "key: UserName", + "in": "path", + "name": "UserName", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Airline" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } } - } } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - }, - "post": { - "summary": "Creates a single person.", - "tags": [ - "People" - ], - "requestBody": { - "description": "New person", - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Person-create" - } + }, + "/People('{UserName}')/Microsoft.OData.SampleService.Models.TripPin.GetFriendsTrips(userName={userName})": { + "get": { + "summary": "Invokes function GetFriendsTrips", + "tags": [ + "People" + ], + "parameters": [ + { + "description": "key: UserName", + "in": "path", + "name": "UserName", + "required": true, + "schema": { + "type": "string" + } + }, + { + "required": true, + "in": "path", + "name": "userName", + "description": "String value needs to be enclosed in single quotes", + "schema": { + "type": "string", + "pattern": "^'([^']|'')*'$" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "object", + "title": "Collection of Trip", + "properties": { + "@odata.count": { + "$ref": "#/components/schemas/count" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Trip" + } + } + } + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } } - } }, - "responses": { - "201": { - "description": "Created person", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Person" + "/People('{UserName}')/Microsoft.OData.SampleService.Models.TripPin.ShareTrip": { + "post": { + "summary": "Invokes action ShareTrip", + "tags": [ + "People" + ], + "responses": { + "204": { + "description": "Success" + }, + "4XX": { + "$ref": "#/components/responses/error" + } + }, + "parameters": [ + { + "description": "key: UserName", + "in": "path", + "name": "UserName", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Action parameters", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "userName": { + "type": "string" + }, + "tripId": { + "type": "integer", + "format": "int32" + } + } + } + } + } } - } } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - } - }, - "/People('{UserName}')": { - "parameters": [ - { - "description": "key: UserName", - "in": "path", - "name": "UserName", - "required": true, - "schema": { - "type": "string" - } - } - ], - "get": { - "summary": "Retrieves a single person.", - "tags": [ - "People" - ], - "parameters": [ - { - "name": "$select", - "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "UserName", - "FirstName", - "LastName", - "Emails", - "AddressInfo", - "Gender", - "Concurrency" - ] - } - } - }, - { - "name": "$expand", - "description": "The value of $expand query option is a comma-separated list of navigation property names, stream property names, or $value indicating the stream content of a media-entity. The corresponding related entities and stream values will be represented inline, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "*", - "Friends", - "Trips", - "Photo" - ] - } - } - } - ], - "responses": { - "200": { - "description": "Retrieved person", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Person" - } - } - } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - }, - "patch": { - "summary": "Changes a single person.", - "tags": [ - "People" - ], - "requestBody": { - "description": "New property values", - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Person-update" - } - } - } }, - "responses": { - "204": { - "description": "Success" - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - }, - "delete": { - "summary": "Deletes a single person.", - "tags": [ - "People" - ], - "responses": { - "204": { - "description": "Success" - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - } - }, - "/People('{UserName}')/Friends": { - "parameters": [ - { - "description": "key: UserName", - "in": "path", - "name": "UserName", - "required": true, - "schema": { - "type": "string" - } - } - ], - "get": { - "summary": "Retrieves a list of friends of a person.", - "tags": [ - "People" - ], - "parameters": [ - { - "$ref": "#/components/parameters/top" - }, - { - "$ref": "#/components/parameters/skip" - }, - { - "$ref": "#/components/parameters/search" - }, - { - "name": "$filter", - "description": "Filter items by property values, see [Filtering](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionfilter)", - "in": "query", - "schema": { - "type": "string" - } - }, - { - "$ref": "#/components/parameters/count" - }, - { - "name": "$orderby", - "description": "Order items by property values, see [Sorting](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionorderby)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "UserName", - "UserName desc", - "FirstName", - "FirstName desc", - "LastName", - "LastName desc", - "Emails", - "Emails desc", - "AddressInfo/Address", - "AddressInfo/Address desc", - "AddressInfo/City/CountryRegion", - "AddressInfo/City/CountryRegion desc", - "AddressInfo/City/Name", - "AddressInfo/City/Name desc", - "AddressInfo/City/Region", - "AddressInfo/City/Region desc", - "Gender", - "Gender desc", - "Concurrency", - "Concurrency desc" - ] - } - } - }, - { - "name": "$select", - "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "UserName", - "FirstName", - "LastName", - "Emails", - "AddressInfo", - "Gender", - "Concurrency" - ] - } - } - }, - { - "name": "$expand", - "description": "The value of $expand query option is a comma-separated list of navigation property names, stream property names, or $value indicating the stream content of a media-entity. The corresponding related entities and stream values will be represented inline, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "*", - "Friends", - "Trips", - "Photo" - ] - } - } - } - ], - "responses": { - "200": { - "description": "Retrieved friends", - "content": { - "application/json": { - "schema": { - "type": "object", - "title": "Collection of Person", - "properties": { - "@count": { - "$ref": "#/components/schemas/count" - }, - "value": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Person" - } - } - } + "/People('{UserName}')/Photo": { + "parameters": [ + { + "description": "key: UserName", + "in": "path", + "name": "UserName", + "required": true, + "schema": { + "type": "string" + } + } + ], + "get": { + "summary": "Retrieves photo of a person.", + "tags": [ + "People", + "Photos" + ], + "parameters": [ + { + "name": "$select", + "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "Id", + "Name" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved photo", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Photo" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } } - } - } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - }, - "post": { - "summary": "Creates a single friend of a person.", - "tags": [ - "People" - ], - "requestBody": { - "description": "New friend", - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Person-create" - } } - } }, - "responses": { - "201": { - "description": "Created friend", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Person" + "/People('{UserName}')/Trips": { + "parameters": [ + { + "description": "key: UserName", + "in": "path", + "name": "UserName", + "required": true, + "schema": { + "type": "string" + } } - } - } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - } - }, - "/People('{UserName}')/Microsoft.OData.SampleService.Models.TripPin.GetFavoriteAirline": { - "get": { - "summary": "Invokes function GetFavoriteAirline", - "tags": [ - "People" - ], - "parameters": [ - { - "description": "key: UserName", - "in": "path", - "name": "UserName", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Airline" + ], + "get": { + "summary": "Retrieves a list of trips of a person.", + "tags": [ + "People" + ], + "parameters": [ + { + "$ref": "#/components/parameters/top" + }, + { + "$ref": "#/components/parameters/skip" + }, + { + "$ref": "#/components/parameters/search" + }, + { + "name": "$filter", + "description": "Filter items by property values, see [Filtering](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionfilter)", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/count" + }, + { + "name": "$orderby", + "description": "Order items by property values, see [Sorting](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionorderby)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "TripId", + "TripId desc", + "ShareId", + "ShareId desc", + "Description", + "Description desc", + "Name", + "Name desc", + "Budget", + "Budget desc", + "StartsAt", + "StartsAt desc", + "EndsAt", + "EndsAt desc", + "Tags", + "Tags desc" + ] + } + } + }, + { + "name": "$select", + "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "TripId", + "ShareId", + "Description", + "Name", + "Budget", + "StartsAt", + "EndsAt", + "Tags" + ] + } + } + }, + { + "name": "$expand", + "description": "The value of $expand query option is a comma-separated list of navigation property names, stream property names, or $value indicating the stream content of a media-entity. The corresponding related entities and stream values will be represented inline, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Photos", + "PlanItems" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved trips", + "content": { + "application/json": { + "schema": { + "type": "object", + "title": "Collection of Trip", + "properties": { + "@odata.count": { + "$ref": "#/components/schemas/count" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Trip" + } + } + } + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } } - } - } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - } - }, - "/People('{UserName}')/Microsoft.OData.SampleService.Models.TripPin.GetFriendsTrips": { - "get": { - "summary": "Invokes function GetFriendsTrips", - "tags": [ - "People" - ], - "parameters": [ - { - "description": "key: UserName", - "in": "path", - "name": "UserName", - "required": true, - "schema": { - "type": "string" - } - }, - { - "required": true, - "in": "query", - "name": "userName", - "description": "String value needs to be enclosed in single quotes", - "schema": { - "type": "string", - "pattern": "^'([^']|'')*'$" - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "title": "Collection of Trip", - "properties": { - "@count": { - "$ref": "#/components/schemas/count" - }, - "value": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Trip" - } - } - } + }, + "post": { + "summary": "Creates a single trip of a person.", + "tags": [ + "People" + ], + "requestBody": { + "description": "New trip", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Trip-create" + } + } + } + }, + "responses": { + "201": { + "description": "Created trip", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Trip" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } } - } } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - } - }, - "/People('{UserName}')/Microsoft.OData.SampleService.Models.TripPin.ShareTrip": { - "post": { - "summary": "Invokes action ShareTrip", - "tags": [ - "People" - ], - "responses": { - "204": { - "description": "Success" - }, - "4XX": { - "$ref": "#/components/responses/error" - } }, - "parameters": [ - { - "description": "key: UserName", - "in": "path", - "name": "UserName", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "description": "Action parameters", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "userName": { - "type": "string" - }, - "tripId": { - "type": "integer", - "format": "int32" - } + "/People('{UserName}')/Trips({TripId_1})": { + "parameters": [ + { + "description": "key: UserName", + "in": "path", + "name": "UserName", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "key: TripId", + "in": "path", + "name": "TripId_1", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } } - } - } - } - } - } - }, - "/People('{UserName}')/Photo": { - "parameters": [ - { - "description": "key: UserName", - "in": "path", - "name": "UserName", - "required": true, - "schema": { - "type": "string" - } - } - ], - "get": { - "summary": "Retrieves photo of a person.", - "tags": [ - "People", - "Photos" - ], - "parameters": [ - { - "name": "$select", - "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "Id", - "Name" - ] - } - } - } - ], - "responses": { - "200": { - "description": "Retrieved photo", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Photo" + ], + "get": { + "summary": "Retrieves a single trip of a person.", + "tags": [ + "People" + ], + "parameters": [ + { + "name": "$select", + "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "TripId", + "ShareId", + "Description", + "Name", + "Budget", + "StartsAt", + "EndsAt", + "Tags" + ] + } + } + }, + { + "name": "$expand", + "description": "The value of $expand query option is a comma-separated list of navigation property names, stream property names, or $value indicating the stream content of a media-entity. The corresponding related entities and stream values will be represented inline, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "*", + "Photos", + "PlanItems" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved trip", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Trip" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } } - } - } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - } - }, - "/People('{UserName}')/Trips": { - "parameters": [ - { - "description": "key: UserName", - "in": "path", - "name": "UserName", - "required": true, - "schema": { - "type": "string" - } - } - ], - "get": { - "summary": "Retrieves a list of trips of a person.", - "tags": [ - "People" - ], - "parameters": [ - { - "$ref": "#/components/parameters/top" - }, - { - "$ref": "#/components/parameters/skip" - }, - { - "$ref": "#/components/parameters/search" - }, - { - "name": "$filter", - "description": "Filter items by property values, see [Filtering](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionfilter)", - "in": "query", - "schema": { - "type": "string" - } - }, - { - "$ref": "#/components/parameters/count" - }, - { - "name": "$orderby", - "description": "Order items by property values, see [Sorting](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionorderby)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "TripId", - "TripId desc", - "ShareId", - "ShareId desc", - "Description", - "Description desc", - "Name", - "Name desc", - "Budget", - "Budget desc", - "StartsAt", - "StartsAt desc", - "EndsAt", - "EndsAt desc", - "Tags", - "Tags desc" - ] - } - } - }, - { - "name": "$select", - "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "TripId", - "ShareId", - "Description", - "Name", - "Budget", - "StartsAt", - "EndsAt", - "Tags" - ] - } - } - }, - { - "name": "$expand", - "description": "The value of $expand query option is a comma-separated list of navigation property names, stream property names, or $value indicating the stream content of a media-entity. The corresponding related entities and stream values will be represented inline, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "*", - "Photos", - "PlanItems" - ] - } - } - } - ], - "responses": { - "200": { - "description": "Retrieved trips", - "content": { - "application/json": { - "schema": { - "type": "object", - "title": "Collection of Trip", - "properties": { - "@count": { - "$ref": "#/components/schemas/count" - }, - "value": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Trip" - } - } - } + }, + "patch": { + "summary": "Changes a single trip of a person.", + "tags": [ + "People" + ], + "requestBody": { + "description": "New property values", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Trip-update" + } + } + } + }, + "responses": { + "204": { + "description": "Success" + }, + "4XX": { + "$ref": "#/components/responses/error" + } } - } - } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - }, - "post": { - "summary": "Creates a single trip of a person.", - "tags": [ - "People" - ], - "requestBody": { - "description": "New trip", - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Trip-create" - } - } - } - }, - "responses": { - "201": { - "description": "Created trip", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Trip" + }, + "delete": { + "summary": "Deletes a single trip of a person.", + "tags": [ + "People" + ], + "responses": { + "204": { + "description": "Success" + }, + "4XX": { + "$ref": "#/components/responses/error" + } } - } } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - } - }, - "/People('{UserName}')/Trips({TripId_1})": { - "parameters": [ - { - "description": "key: UserName", - "in": "path", - "name": "UserName", - "required": true, - "schema": { - "type": "string" - } }, - { - "description": "key: TripId", - "in": "path", - "name": "TripId_1", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - } - ], - "get": { - "summary": "Retrieves a single trip of a person.", - "tags": [ - "People" - ], - "parameters": [ - { - "name": "$select", - "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "TripId", - "ShareId", - "Description", - "Name", - "Budget", - "StartsAt", - "EndsAt", - "Tags" - ] - } - } - }, - { - "name": "$expand", - "description": "The value of $expand query option is a comma-separated list of navigation property names, stream property names, or $value indicating the stream content of a media-entity. The corresponding related entities and stream values will be represented inline, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "*", - "Photos", - "PlanItems" - ] - } - } - } - ], - "responses": { - "200": { - "description": "Retrieved trip", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Trip" + "/People('{UserName}')/Trips({TripId_1})/Microsoft.OData.SampleService.Models.TripPin.GetInvolvedPeople()": { + "get": { + "summary": "Invokes function GetInvolvedPeople", + "tags": [ + "People" + ], + "parameters": [ + { + "description": "key: UserName", + "in": "path", + "name": "UserName", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "key: TripId", + "in": "path", + "name": "TripId_1", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "object", + "title": "Collection of Person", + "properties": { + "@odata.count": { + "$ref": "#/components/schemas/count" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Person" + } + } + } + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } } - } - } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - }, - "patch": { - "summary": "Changes a single trip of a person.", - "tags": [ - "People" - ], - "requestBody": { - "description": "New property values", - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Trip-update" - } } - } }, - "responses": { - "204": { - "description": "Success" - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - }, - "delete": { - "summary": "Deletes a single trip of a person.", - "tags": [ - "People" - ], - "responses": { - "204": { - "description": "Success" - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - } - }, - "/People('{UserName}')/Trips({TripId_1})/Microsoft.OData.SampleService.Models.TripPin.GetInvolvedPeople": { - "get": { - "summary": "Invokes function GetInvolvedPeople", - "tags": [ - "People" - ], - "parameters": [ - { - "description": "key: UserName", - "in": "path", - "name": "UserName", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "key: TripId", - "in": "path", - "name": "TripId_1", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "title": "Collection of Person", - "properties": { - "@count": { - "$ref": "#/components/schemas/count" - }, - "value": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Person" - } - } - } + "/People('{UserName}')/Trips({TripId_1})/Photos": { + "parameters": [ + { + "description": "key: UserName", + "in": "path", + "name": "UserName", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "key: TripId", + "in": "path", + "name": "TripId_1", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } } - } - } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - } - }, - "/People('{UserName}')/Trips({TripId_1})/Photos": { - "parameters": [ - { - "description": "key: UserName", - "in": "path", - "name": "UserName", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "key: TripId", - "in": "path", - "name": "TripId_1", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - } - ], - "get": { - "summary": "Retrieves a list of photos of a person.", - "tags": [ - "People" - ], - "parameters": [ - { - "$ref": "#/components/parameters/top" - }, - { - "$ref": "#/components/parameters/skip" - }, - { - "$ref": "#/components/parameters/search" - }, - { - "name": "$filter", - "description": "Filter items by property values, see [Filtering](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionfilter)", - "in": "query", - "schema": { - "type": "string" - } - }, - { - "$ref": "#/components/parameters/count" - }, - { - "name": "$orderby", - "description": "Order items by property values, see [Sorting](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionorderby)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "Id", - "Id desc", - "Name", - "Name desc" - ] - } - } - }, - { - "name": "$select", - "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "Id", - "Name" - ] - } - } - } - ], - "responses": { - "200": { - "description": "Retrieved photos", - "content": { - "application/json": { - "schema": { - "type": "object", - "title": "Collection of Photo", - "properties": { - "@count": { - "$ref": "#/components/schemas/count" - }, - "value": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Photo" - } - } - } + ], + "get": { + "summary": "Retrieves a list of photos of a person.", + "tags": [ + "People" + ], + "parameters": [ + { + "$ref": "#/components/parameters/top" + }, + { + "$ref": "#/components/parameters/skip" + }, + { + "$ref": "#/components/parameters/search" + }, + { + "name": "$filter", + "description": "Filter items by property values, see [Filtering](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionfilter)", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/count" + }, + { + "name": "$orderby", + "description": "Order items by property values, see [Sorting](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionorderby)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "Id", + "Id desc", + "Name", + "Name desc" + ] + } + } + }, + { + "name": "$select", + "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "Id", + "Name" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved photos", + "content": { + "application/json": { + "schema": { + "type": "object", + "title": "Collection of Photo", + "properties": { + "@odata.count": { + "$ref": "#/components/schemas/count" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Photo" + } + } + } + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } } - } } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - } - }, - "/People('{UserName}')/Trips({TripId_1})/PlanItems": { - "parameters": [ - { - "description": "key: UserName", - "in": "path", - "name": "UserName", - "required": true, - "schema": { - "type": "string" - } }, - { - "description": "key: TripId", - "in": "path", - "name": "TripId_1", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - } - ], - "get": { - "summary": "Retrieves a list of plan items of a person.", - "tags": [ - "People" - ], - "parameters": [ - { - "$ref": "#/components/parameters/top" - }, - { - "$ref": "#/components/parameters/skip" - }, - { - "$ref": "#/components/parameters/search" - }, - { - "name": "$filter", - "description": "Filter items by property values, see [Filtering](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionfilter)", - "in": "query", - "schema": { - "type": "string" - } - }, - { - "$ref": "#/components/parameters/count" - }, - { - "name": "$orderby", - "description": "Order items by property values, see [Sorting](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionorderby)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "PlanItemId", - "PlanItemId desc", - "ConfirmationCode", - "ConfirmationCode desc", - "StartsAt", - "StartsAt desc", - "EndsAt", - "EndsAt desc", - "Duration", - "Duration desc" - ] - } - } - }, - { - "name": "$select", - "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "PlanItemId", - "ConfirmationCode", - "StartsAt", - "EndsAt", - "Duration" - ] - } - } - } - ], - "responses": { - "200": { - "description": "Retrieved plan items", - "content": { - "application/json": { - "schema": { - "type": "object", - "title": "Collection of PlanItem", - "properties": { - "@count": { - "$ref": "#/components/schemas/count" - }, - "value": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.PlanItem" - } - } - } + "/People('{UserName}')/Trips({TripId_1})/PlanItems": { + "parameters": [ + { + "description": "key: UserName", + "in": "path", + "name": "UserName", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "key: TripId", + "in": "path", + "name": "TripId_1", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } } - } - } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - }, - "post": { - "summary": "Creates a single plan item of a person.", - "tags": [ - "People" - ], - "requestBody": { - "description": "New plan item", - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.PlanItem-create" - } - } - } - }, - "responses": { - "201": { - "description": "Created plan item", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.PlanItem" + ], + "get": { + "summary": "Retrieves a list of plan items of a person.", + "tags": [ + "People" + ], + "parameters": [ + { + "$ref": "#/components/parameters/top" + }, + { + "$ref": "#/components/parameters/skip" + }, + { + "$ref": "#/components/parameters/search" + }, + { + "name": "$filter", + "description": "Filter items by property values, see [Filtering](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionfilter)", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/count" + }, + { + "name": "$orderby", + "description": "Order items by property values, see [Sorting](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionorderby)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "PlanItemId", + "PlanItemId desc", + "ConfirmationCode", + "ConfirmationCode desc", + "StartsAt", + "StartsAt desc", + "EndsAt", + "EndsAt desc", + "Duration", + "Duration desc" + ] + } + } + }, + { + "name": "$select", + "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "PlanItemId", + "ConfirmationCode", + "StartsAt", + "EndsAt", + "Duration" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved plan items", + "content": { + "application/json": { + "schema": { + "type": "object", + "title": "Collection of PlanItem", + "properties": { + "@odata.count": { + "$ref": "#/components/schemas/count" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.PlanItem" + } + } + } + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "post": { + "summary": "Creates a single plan item of a person.", + "tags": [ + "People" + ], + "requestBody": { + "description": "New plan item", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.PlanItem-create" + } + } + } + }, + "responses": { + "201": { + "description": "Created plan item", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.PlanItem" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } } - } } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - } - }, - "/People('{UserName}')/Trips({TripId_1})/PlanItems({PlanItemId_2})": { - "parameters": [ - { - "description": "key: UserName", - "in": "path", - "name": "UserName", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "key: TripId", - "in": "path", - "name": "TripId_1", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } }, - { - "description": "key: PlanItemId", - "in": "path", - "name": "PlanItemId_2", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - } - ], - "get": { - "summary": "Retrieves a single plan item of a person.", - "tags": [ - "People" - ], - "parameters": [ - { - "name": "$select", - "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "PlanItemId", - "ConfirmationCode", - "StartsAt", - "EndsAt", - "Duration" - ] - } - } - } - ], - "responses": { - "200": { - "description": "Retrieved plan item", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.PlanItem" + "/People('{UserName}')/Trips({TripId_1})/PlanItems({PlanItemId_2})": { + "parameters": [ + { + "description": "key: UserName", + "in": "path", + "name": "UserName", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "key: TripId", + "in": "path", + "name": "TripId_1", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "description": "key: PlanItemId", + "in": "path", + "name": "PlanItemId_2", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "get": { + "summary": "Retrieves a single plan item of a person.", + "tags": [ + "People" + ], + "parameters": [ + { + "name": "$select", + "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "PlanItemId", + "ConfirmationCode", + "StartsAt", + "EndsAt", + "Duration" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved plan item", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.PlanItem" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "patch": { + "summary": "Changes a single plan item of a person.", + "tags": [ + "People" + ], + "requestBody": { + "description": "New property values", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.PlanItem-update" + } + } + } + }, + "responses": { + "204": { + "description": "Success" + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "delete": { + "summary": "Deletes a single plan item of a person.", + "tags": [ + "People" + ], + "responses": { + "204": { + "description": "Success" + }, + "4XX": { + "$ref": "#/components/responses/error" + } } - } - } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - }, - "patch": { - "summary": "Changes a single plan item of a person.", - "tags": [ - "People" - ], - "requestBody": { - "description": "New property values", - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.PlanItem-update" - } } - } }, - "responses": { - "204": { - "description": "Success" - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - }, - "delete": { - "summary": "Deletes a single plan item of a person.", - "tags": [ - "People" - ], - "responses": { - "204": { - "description": "Success" - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - } - }, - "/Photos": { - "get": { - "summary": "Retrieves a list of photos.", - "tags": [ - "Photos" - ], - "parameters": [ - { - "$ref": "#/components/parameters/top" - }, - { - "$ref": "#/components/parameters/skip" - }, - { - "$ref": "#/components/parameters/search" - }, - { - "name": "$filter", - "description": "Filter items by property values, see [Filtering](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionfilter)", - "in": "query", - "schema": { - "type": "string" - } - }, - { - "$ref": "#/components/parameters/count" - }, - { - "name": "$orderby", - "description": "Order items by property values, see [Sorting](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionorderby)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "Id", - "Id desc", - "Name", - "Name desc" - ] - } - } - }, - { - "name": "$select", - "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "Id", - "Name" - ] - } - } - } - ], - "responses": { - "200": { - "description": "Retrieved photos", - "content": { - "application/json": { - "schema": { - "type": "object", - "title": "Collection of Photo", - "properties": { - "@count": { - "$ref": "#/components/schemas/count" - }, - "value": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Photo" - } - } - } + "/Photos": { + "get": { + "summary": "Retrieves a list of photos.", + "tags": [ + "Photos" + ], + "parameters": [ + { + "$ref": "#/components/parameters/top" + }, + { + "$ref": "#/components/parameters/skip" + }, + { + "$ref": "#/components/parameters/search" + }, + { + "name": "$filter", + "description": "Filter items by property values, see [Filtering](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionfilter)", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/count" + }, + { + "name": "$orderby", + "description": "Order items by property values, see [Sorting](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionorderby)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "Id", + "Id desc", + "Name", + "Name desc" + ] + } + } + }, + { + "name": "$select", + "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "Id", + "Name" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved photos", + "content": { + "application/json": { + "schema": { + "type": "object", + "title": "Collection of Photo", + "properties": { + "@odata.count": { + "$ref": "#/components/schemas/count" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Photo" + } + } + } + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "post": { + "summary": "Creates a single photo.", + "tags": [ + "Photos" + ], + "requestBody": { + "description": "New photo", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Photo-create" + } + } + } + }, + "responses": { + "201": { + "description": "Created photo", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Photo" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } } - } } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - }, - "post": { - "summary": "Creates a single photo.", - "tags": [ - "Photos" - ], - "requestBody": { - "description": "New photo", - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Photo-create" - } + }, + "/Photos({Id})": { + "parameters": [ + { + "description": "key: Id", + "in": "path", + "name": "Id", + "required": true, + "schema": { + "anyOf": [ + { + "type": "integer", + "format": "int64" + }, + { + "type": "string" + } + ], + "example": "42" + } + } + ], + "get": { + "summary": "Retrieves a single photo.", + "tags": [ + "Photos" + ], + "parameters": [ + { + "name": "$select", + "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "Id", + "Name" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved photo", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Photo" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "patch": { + "summary": "Changes a single photo.", + "tags": [ + "Photos" + ], + "requestBody": { + "description": "New property values", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Photo-update" + } + } + } + }, + "responses": { + "204": { + "description": "Success" + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "delete": { + "summary": "Deletes a single photo.", + "tags": [ + "Photos" + ], + "responses": { + "204": { + "description": "Success" + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } } - } }, - "responses": { - "201": { - "description": "Created photo", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Photo" + "/ResetDataSource": { + "post": { + "summary": "Invokes action ResetDataSource", + "tags": [ + "Service Operations" + ], + "responses": { + "204": { + "description": "Success" + }, + "4XX": { + "$ref": "#/components/responses/error" + } + }, + "requestBody": { + "required": false, + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } } - } } - }, - "4XX": { - "$ref": "#/components/responses/error" - } } - } }, - "/Photos({Id})": { - "parameters": [ - { - "description": "key: Id", - "in": "path", - "name": "Id", - "required": true, - "schema": { - "anyOf": [ - { - "type": "integer", - "format": "int64" - }, - { - "type": "string" - } - ], - "example": "42" - } - } - ], - "get": { - "summary": "Retrieves a single photo.", - "tags": [ - "Photos" - ], - "parameters": [ - { - "name": "$select", - "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { + "components": { + "schemas": { + "Microsoft.OData.SampleService.Models.TripPin.Airline": { + "title": "Airline", + "type": "object", + "properties": { + "AirlineCode": { + "type": "string" + }, + "Name": { + "type": "string" + } + } + }, + "Microsoft.OData.SampleService.Models.TripPin.Airline-create": { + "title": "Airline (for create)", + "type": "object", + "properties": { + "Name": { + "type": "string" + } + } + }, + "Microsoft.OData.SampleService.Models.TripPin.Airline-update": { + "title": "Airline (for update)", + "type": "object", + "properties": { + "Name": { + "type": "string" + } + } + }, + "Microsoft.OData.SampleService.Models.TripPin.Airport": { + "title": "Airport", + "type": "object", + "properties": { + "IcaoCode": { + "type": "string" + }, + "Name": { + "type": "string" + }, + "IataCode": { + "type": "string" + }, + "Location": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.AirportLocation" + } + } + }, + "Microsoft.OData.SampleService.Models.TripPin.Airport-update": { + "title": "Airport (for update)", + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "Location": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.AirportLocation-update" + } + } + }, + "Microsoft.OData.SampleService.Models.TripPin.AirportLocation": { + "title": "AirportLocation", + "type": "object", + "properties": { + "Address": { + "type": "string" + }, + "City": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.City" + }, + "Loc": { + "$ref": "#/components/schemas/geoPoint" + } + } + }, + "Microsoft.OData.SampleService.Models.TripPin.AirportLocation-create": { + "title": "AirportLocation (for create)", + "type": "object", + "properties": { + "Address": { + "type": "string" + }, + "City": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.City-create" + }, + "Loc": { + "$ref": "#/components/schemas/geoPoint" + } + } + }, + "Microsoft.OData.SampleService.Models.TripPin.AirportLocation-update": { + "title": "AirportLocation (for update)", + "type": "object", + "properties": { + "Address": { + "type": "string" + }, + "City": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.City-update" + }, + "Loc": { + "$ref": "#/components/schemas/geoPoint" + } + } + }, + "Microsoft.OData.SampleService.Models.TripPin.City": { + "title": "City", + "type": "object", + "properties": { + "CountryRegion": { + "type": "string" + }, + "Name": { + "type": "string" + }, + "Region": { + "type": "string" + } + } + }, + "Microsoft.OData.SampleService.Models.TripPin.City-create": { + "title": "City (for create)", + "type": "object", + "properties": { + "CountryRegion": { + "type": "string" + }, + "Name": { + "type": "string" + }, + "Region": { + "type": "string" + } + } + }, + "Microsoft.OData.SampleService.Models.TripPin.City-update": { + "title": "City (for update)", + "type": "object", + "properties": { + "CountryRegion": { + "type": "string" + }, + "Name": { + "type": "string" + }, + "Region": { + "type": "string" + } + } + }, + "Microsoft.OData.SampleService.Models.TripPin.Event": { + "title": "Event", + "type": "object", + "properties": { + "PlanItemId": { + "type": "integer", + "format": "int32" + }, + "ConfirmationCode": { + "type": "string", + "nullable": true + }, + "StartsAt": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z", + "nullable": true + }, + "EndsAt": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z", + "nullable": true + }, + "Duration": { + "type": "string", + "format": "duration", + "example": "P4DT15H51M04S", + "nullable": true + }, + "Description": { + "type": "string", + "nullable": true + }, + "OccursAt": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.EventLocation" + } + } + }, + "Microsoft.OData.SampleService.Models.TripPin.Event-create": { + "title": "Event (for create)", + "type": "object", + "properties": { + "ConfirmationCode": { + "type": "string", + "nullable": true + }, + "StartsAt": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z", + "nullable": true + }, + "EndsAt": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z", + "nullable": true + }, + "Duration": { + "type": "string", + "format": "duration", + "example": "P4DT15H51M04S", + "nullable": true + }, + "Description": { + "type": "string", + "nullable": true + }, + "OccursAt": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.EventLocation-create" + } + } + }, + "Microsoft.OData.SampleService.Models.TripPin.Event-update": { + "title": "Event (for update)", + "type": "object", + "properties": { + "ConfirmationCode": { + "type": "string", + "nullable": true + }, + "StartsAt": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z", + "nullable": true + }, + "EndsAt": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z", + "nullable": true + }, + "Duration": { + "type": "string", + "format": "duration", + "example": "P4DT15H51M04S", + "nullable": true + }, + "Description": { + "type": "string", + "nullable": true + }, + "OccursAt": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.EventLocation-update" + } + } + }, + "Microsoft.OData.SampleService.Models.TripPin.EventLocation": { + "title": "EventLocation", + "type": "object", + "properties": { + "Address": { + "type": "string" + }, + "City": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.City" + }, + "BuildingInfo": { + "type": "string", + "nullable": true + } + } + }, + "Microsoft.OData.SampleService.Models.TripPin.EventLocation-create": { + "title": "EventLocation (for create)", + "type": "object", + "properties": { + "Address": { + "type": "string" + }, + "City": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.City-create" + }, + "BuildingInfo": { + "type": "string", + "nullable": true + } + } + }, + "Microsoft.OData.SampleService.Models.TripPin.EventLocation-update": { + "title": "EventLocation (for update)", + "type": "object", + "properties": { + "Address": { + "type": "string" + }, + "City": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.City-update" + }, + "BuildingInfo": { + "type": "string", + "nullable": true + } + } + }, + "Microsoft.OData.SampleService.Models.TripPin.Flight": { + "title": "Flight", + "type": "object", + "properties": { + "PlanItemId": { + "type": "integer", + "format": "int32" + }, + "ConfirmationCode": { + "type": "string", + "nullable": true + }, + "StartsAt": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z", + "nullable": true + }, + "EndsAt": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z", + "nullable": true + }, + "Duration": { + "type": "string", + "format": "duration", + "example": "P4DT15H51M04S", + "nullable": true + }, + "SeatNumber": { + "type": "string", + "nullable": true + }, + "FlightNumber": { + "type": "string" + }, + "From": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Airport" + }, + "To": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Airport" + }, + "Airline": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Airline" + } + } + }, + "Microsoft.OData.SampleService.Models.TripPin.Flight-create": { + "title": "Flight (for create)", + "type": "object", + "properties": { + "ConfirmationCode": { + "type": "string", + "nullable": true + }, + "StartsAt": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z", + "nullable": true + }, + "EndsAt": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z", + "nullable": true + }, + "Duration": { + "type": "string", + "format": "duration", + "example": "P4DT15H51M04S", + "nullable": true + }, + "SeatNumber": { + "type": "string", + "nullable": true + }, + "FlightNumber": { + "type": "string" + } + } + }, + "Microsoft.OData.SampleService.Models.TripPin.Flight-update": { + "title": "Flight (for update)", + "type": "object", + "properties": { + "ConfirmationCode": { + "type": "string", + "nullable": true + }, + "StartsAt": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z", + "nullable": true + }, + "EndsAt": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z", + "nullable": true + }, + "Duration": { + "type": "string", + "format": "duration", + "example": "P4DT15H51M04S", + "nullable": true + }, + "SeatNumber": { + "type": "string", + "nullable": true + }, + "FlightNumber": { + "type": "string" + } + } + }, + "Microsoft.OData.SampleService.Models.TripPin.Location": { + "title": "Location", + "type": "object", + "properties": { + "Address": { + "type": "string" + }, + "City": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.City" + } + }, + "anyOf": [ + { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.EventLocation" + }, + { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.AirportLocation" + }, + {} + ] + }, + "Microsoft.OData.SampleService.Models.TripPin.Location-create": { + "title": "Location (for create)", + "type": "object", + "properties": { + "Address": { + "type": "string" + }, + "City": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.City-create" + } + }, + "anyOf": [ + { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.EventLocation-create" + }, + { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.AirportLocation-create" + }, + {} + ] + }, + "Microsoft.OData.SampleService.Models.TripPin.Location-update": { + "title": "Location (for update)", + "type": "object", + "properties": { + "Address": { + "type": "string" + }, + "City": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.City-update" + } + }, + "anyOf": [ + { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.EventLocation-update" + }, + { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.AirportLocation-update" + }, + {} + ] + }, + "Microsoft.OData.SampleService.Models.TripPin.Person": { + "title": "Person", + "type": "object", + "properties": { + "UserName": { + "type": "string" + }, + "FirstName": { + "type": "string" + }, + "LastName": { + "type": "string" + }, + "Emails": { + "type": "array", + "items": { + "type": "string" + } + }, + "AddressInfo": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Location" + } + }, + "Gender": { + "allOf": [ + { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.PersonGender" + } + ], + "nullable": true + }, + "Concurrency": { + "anyOf": [ + { + "type": "integer", + "format": "int64" + }, + { + "type": "string" + } + ], + "example": "42" + }, + "Friends": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Person" + } + }, + "Friends@odata.count": { + "$ref": "#/components/schemas/count" + }, + "Trips": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Trip" + } + }, + "Trips@odata.count": { + "$ref": "#/components/schemas/count" + }, + "Photo": { + "allOf": [ + { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Photo" + } + ], + "nullable": true + } + } + }, + "Microsoft.OData.SampleService.Models.TripPin.Person-create": { + "title": "Person (for create)", + "type": "object", + "properties": { + "FirstName": { + "type": "string" + }, + "LastName": { + "type": "string" + }, + "Emails": { + "type": "array", + "items": { + "type": "string" + } + }, + "AddressInfo": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Location-create" + } + }, + "Gender": { + "allOf": [ + { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.PersonGender" + } + ], + "nullable": true + }, + "Trips": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Trip-create" + } + } + } + }, + "Microsoft.OData.SampleService.Models.TripPin.Person-update": { + "title": "Person (for update)", + "type": "object", + "properties": { + "FirstName": { + "type": "string" + }, + "LastName": { + "type": "string" + }, + "Emails": { + "type": "array", + "items": { + "type": "string" + } + }, + "AddressInfo": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Location-update" + } + }, + "Gender": { + "allOf": [ + { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.PersonGender" + } + ], + "nullable": true + }, + "Trips": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Trip-create" + } + } + } + }, + "Microsoft.OData.SampleService.Models.TripPin.PersonGender": { "type": "string", + "title": "PersonGender", "enum": [ - "Id", - "Name" + "Male", + "Female", + "Unknown" ] - } - } - } - ], - "responses": { - "200": { - "description": "Retrieved photo", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Photo" + }, + "Microsoft.OData.SampleService.Models.TripPin.Photo": { + "title": "Photo", + "type": "object", + "properties": { + "Id": { + "anyOf": [ + { + "type": "integer", + "format": "int64" + }, + { + "type": "string" + } + ], + "example": "42" + }, + "Name": { + "type": "string", + "nullable": true + } } - } - } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - }, - "patch": { - "summary": "Changes a single photo.", - "tags": [ - "Photos" - ], - "requestBody": { - "description": "New property values", - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Photo-update" - } - } - } - }, - "responses": { - "204": { - "description": "Success" - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - }, - "delete": { - "summary": "Deletes a single photo.", - "tags": [ - "Photos" - ], - "responses": { - "204": { - "description": "Success" - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - } - }, - "/ResetDataSource": { - "post": { - "summary": "Invokes action ResetDataSource", - "tags": [ - "Service Operations" - ], - "responses": { - "204": { - "description": "Success" - }, - "4XX": { - "$ref": "#/components/responses/error" - } - }, - "requestBody": { - "required": false, - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - } - } - } - } - }, - "components": { - "schemas": { - "Microsoft.OData.SampleService.Models.TripPin.Airline": { - "title": "Airline", - "type": "object", - "properties": { - "AirlineCode": { - "type": "string" - }, - "Name": { - "type": "string" - } - } - }, - "Microsoft.OData.SampleService.Models.TripPin.Airline-create": { - "title": "Airline (for create)", - "type": "object", - "properties": { - "Name": { - "type": "string" - } - } - }, - "Microsoft.OData.SampleService.Models.TripPin.Airline-update": { - "title": "Airline (for update)", - "type": "object", - "properties": { - "Name": { - "type": "string" - } - } - }, - "Microsoft.OData.SampleService.Models.TripPin.Airport": { - "title": "Airport", - "type": "object", - "properties": { - "IcaoCode": { - "type": "string" - }, - "Name": { - "type": "string" - }, - "IataCode": { - "type": "string" - }, - "Location": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.AirportLocation" - } - } - }, - "Microsoft.OData.SampleService.Models.TripPin.Airport-update": { - "title": "Airport (for update)", - "type": "object", - "properties": { - "Name": { - "type": "string" - }, - "Location": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.AirportLocation-update" - } - } - }, - "Microsoft.OData.SampleService.Models.TripPin.AirportLocation": { - "title": "AirportLocation", - "type": "object", - "properties": { - "Address": { - "type": "string" - }, - "City": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.City" - }, - "Loc": { - "$ref": "#/components/schemas/geoPoint" - } - } - }, - "Microsoft.OData.SampleService.Models.TripPin.AirportLocation-create": { - "title": "AirportLocation (for create)", - "type": "object", - "properties": { - "Address": { - "type": "string" - }, - "City": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.City-create" - }, - "Loc": { - "$ref": "#/components/schemas/geoPoint" - } - } - }, - "Microsoft.OData.SampleService.Models.TripPin.AirportLocation-update": { - "title": "AirportLocation (for update)", - "type": "object", - "properties": { - "Address": { - "type": "string" - }, - "City": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.City-update" - }, - "Loc": { - "$ref": "#/components/schemas/geoPoint" - } - } - }, - "Microsoft.OData.SampleService.Models.TripPin.City": { - "title": "City", - "type": "object", - "properties": { - "CountryRegion": { - "type": "string" - }, - "Name": { - "type": "string" - }, - "Region": { - "type": "string" - } - } - }, - "Microsoft.OData.SampleService.Models.TripPin.City-create": { - "title": "City (for create)", - "type": "object", - "properties": { - "CountryRegion": { - "type": "string" - }, - "Name": { - "type": "string" - }, - "Region": { - "type": "string" - } - } - }, - "Microsoft.OData.SampleService.Models.TripPin.City-update": { - "title": "City (for update)", - "type": "object", - "properties": { - "CountryRegion": { - "type": "string" - }, - "Name": { - "type": "string" - }, - "Region": { - "type": "string" - } - } - }, - "Microsoft.OData.SampleService.Models.TripPin.Event": { - "title": "Event", - "type": "object", - "properties": { - "PlanItemId": { - "type": "integer", - "format": "int32" - }, - "ConfirmationCode": { - "type": "string", - "nullable": true - }, - "StartsAt": { - "type": "string", - "format": "date-time", - "example": "2017-04-13T15:51:04Z", - "nullable": true - }, - "EndsAt": { - "type": "string", - "format": "date-time", - "example": "2017-04-13T15:51:04Z", - "nullable": true - }, - "Duration": { - "type": "string", - "format": "duration", - "example": "P4DT15H51M04S", - "nullable": true - }, - "Description": { - "type": "string", - "nullable": true - }, - "OccursAt": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.EventLocation" - } - } - }, - "Microsoft.OData.SampleService.Models.TripPin.Event-create": { - "title": "Event (for create)", - "type": "object", - "properties": { - "ConfirmationCode": { - "type": "string", - "nullable": true - }, - "StartsAt": { - "type": "string", - "format": "date-time", - "example": "2017-04-13T15:51:04Z", - "nullable": true - }, - "EndsAt": { - "type": "string", - "format": "date-time", - "example": "2017-04-13T15:51:04Z", - "nullable": true - }, - "Duration": { - "type": "string", - "format": "duration", - "example": "P4DT15H51M04S", - "nullable": true - }, - "Description": { - "type": "string", - "nullable": true - }, - "OccursAt": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.EventLocation-create" - } - } - }, - "Microsoft.OData.SampleService.Models.TripPin.Event-update": { - "title": "Event (for update)", - "type": "object", - "properties": { - "ConfirmationCode": { - "type": "string", - "nullable": true - }, - "StartsAt": { - "type": "string", - "format": "date-time", - "example": "2017-04-13T15:51:04Z", - "nullable": true - }, - "EndsAt": { - "type": "string", - "format": "date-time", - "example": "2017-04-13T15:51:04Z", - "nullable": true - }, - "Duration": { - "type": "string", - "format": "duration", - "example": "P4DT15H51M04S", - "nullable": true - }, - "Description": { - "type": "string", - "nullable": true - }, - "OccursAt": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.EventLocation-update" - } - } - }, - "Microsoft.OData.SampleService.Models.TripPin.EventLocation": { - "title": "EventLocation", - "type": "object", - "properties": { - "Address": { - "type": "string" - }, - "City": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.City" - }, - "BuildingInfo": { - "type": "string", - "nullable": true - } - } - }, - "Microsoft.OData.SampleService.Models.TripPin.EventLocation-create": { - "title": "EventLocation (for create)", - "type": "object", - "properties": { - "Address": { - "type": "string" - }, - "City": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.City-create" - }, - "BuildingInfo": { - "type": "string", - "nullable": true - } - } - }, - "Microsoft.OData.SampleService.Models.TripPin.EventLocation-update": { - "title": "EventLocation (for update)", - "type": "object", - "properties": { - "Address": { - "type": "string" - }, - "City": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.City-update" - }, - "BuildingInfo": { - "type": "string", - "nullable": true - } - } - }, - "Microsoft.OData.SampleService.Models.TripPin.Flight": { - "title": "Flight", - "type": "object", - "properties": { - "PlanItemId": { - "type": "integer", - "format": "int32" - }, - "ConfirmationCode": { - "type": "string", - "nullable": true - }, - "StartsAt": { - "type": "string", - "format": "date-time", - "example": "2017-04-13T15:51:04Z", - "nullable": true - }, - "EndsAt": { - "type": "string", - "format": "date-time", - "example": "2017-04-13T15:51:04Z", - "nullable": true - }, - "Duration": { - "type": "string", - "format": "duration", - "example": "P4DT15H51M04S", - "nullable": true - }, - "SeatNumber": { - "type": "string", - "nullable": true - }, - "FlightNumber": { - "type": "string" - }, - "From": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Airport" - }, - "To": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Airport" - }, - "Airline": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Airline" - } - } - }, - "Microsoft.OData.SampleService.Models.TripPin.Flight-create": { - "title": "Flight (for create)", - "type": "object", - "properties": { - "ConfirmationCode": { - "type": "string", - "nullable": true - }, - "StartsAt": { - "type": "string", - "format": "date-time", - "example": "2017-04-13T15:51:04Z", - "nullable": true - }, - "EndsAt": { - "type": "string", - "format": "date-time", - "example": "2017-04-13T15:51:04Z", - "nullable": true - }, - "Duration": { - "type": "string", - "format": "duration", - "example": "P4DT15H51M04S", - "nullable": true - }, - "SeatNumber": { - "type": "string", - "nullable": true - }, - "FlightNumber": { - "type": "string" - } - } - }, - "Microsoft.OData.SampleService.Models.TripPin.Flight-update": { - "title": "Flight (for update)", - "type": "object", - "properties": { - "ConfirmationCode": { - "type": "string", - "nullable": true - }, - "StartsAt": { - "type": "string", - "format": "date-time", - "example": "2017-04-13T15:51:04Z", - "nullable": true - }, - "EndsAt": { - "type": "string", - "format": "date-time", - "example": "2017-04-13T15:51:04Z", - "nullable": true - }, - "Duration": { - "type": "string", - "format": "duration", - "example": "P4DT15H51M04S", - "nullable": true - }, - "SeatNumber": { - "type": "string", - "nullable": true - }, - "FlightNumber": { - "type": "string" - } - } - }, - "Microsoft.OData.SampleService.Models.TripPin.Location": { - "title": "Location", - "type": "object", - "properties": { - "Address": { - "type": "string" - }, - "City": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.City" - } - }, - "anyOf": [ - { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.EventLocation" - }, - { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.AirportLocation" - }, - {} - ] - }, - "Microsoft.OData.SampleService.Models.TripPin.Location-create": { - "title": "Location (for create)", - "type": "object", - "properties": { - "Address": { - "type": "string" - }, - "City": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.City-create" - } - }, - "anyOf": [ - { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.EventLocation-create" - }, - { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.AirportLocation-create" - }, - {} - ] - }, - "Microsoft.OData.SampleService.Models.TripPin.Location-update": { - "title": "Location (for update)", - "type": "object", - "properties": { - "Address": { - "type": "string" - }, - "City": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.City-update" - } - }, - "anyOf": [ - { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.EventLocation-update" - }, - { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.AirportLocation-update" - }, - {} - ] - }, - "Microsoft.OData.SampleService.Models.TripPin.Person": { - "title": "Person", - "type": "object", - "properties": { - "UserName": { - "type": "string" - }, - "FirstName": { - "type": "string" - }, - "LastName": { - "type": "string" - }, - "Emails": { - "type": "array", - "items": { - "type": "string" - } - }, - "AddressInfo": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Location" - } - }, - "Gender": { - "allOf": [ - { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.PersonGender" - } - ], - "nullable": true - }, - "Concurrency": { - "anyOf": [ - { - "type": "integer", - "format": "int64" - }, - { - "type": "string" - } - ], - "example": "42" - }, - "Friends": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Person" - } - }, - "Friends@count": { - "$ref": "#/components/schemas/count" - }, - "Trips": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Trip" - } - }, - "Trips@count": { - "$ref": "#/components/schemas/count" - }, - "Photo": { - "allOf": [ - { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Photo" - } - ], - "nullable": true - } - } - }, - "Microsoft.OData.SampleService.Models.TripPin.Person-create": { - "title": "Person (for create)", - "type": "object", - "properties": { - "FirstName": { - "type": "string" - }, - "LastName": { - "type": "string" - }, - "Emails": { - "type": "array", - "items": { - "type": "string" - } - }, - "AddressInfo": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Location-create" - } - }, - "Gender": { - "allOf": [ - { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.PersonGender" - } - ], - "nullable": true - }, - "Trips": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Trip-create" - } - } - } - }, - "Microsoft.OData.SampleService.Models.TripPin.Person-update": { - "title": "Person (for update)", - "type": "object", - "properties": { - "FirstName": { - "type": "string" - }, - "LastName": { - "type": "string" - }, - "Emails": { - "type": "array", - "items": { - "type": "string" - } - }, - "AddressInfo": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Location-update" - } - }, - "Gender": { - "allOf": [ - { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.PersonGender" - } - ], - "nullable": true - }, - "Trips": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Trip-create" - } - } - } - }, - "Microsoft.OData.SampleService.Models.TripPin.PersonGender": { - "type": "string", - "title": "PersonGender", - "enum": [ - "Male", - "Female", - "Unknown" - ] - }, - "Microsoft.OData.SampleService.Models.TripPin.Photo": { - "title": "Photo", - "type": "object", - "properties": { - "Id": { - "anyOf": [ - { - "type": "integer", - "format": "int64" - }, - { - "type": "string" - } - ], - "example": "42" - }, - "Name": { - "type": "string", - "nullable": true - } - } - }, - "Microsoft.OData.SampleService.Models.TripPin.Photo-create": { - "title": "Photo (for create)", - "type": "object", - "properties": { - "Name": { - "type": "string", - "nullable": true - } - } - }, - "Microsoft.OData.SampleService.Models.TripPin.Photo-update": { - "title": "Photo (for update)", - "type": "object", - "properties": { - "Name": { - "type": "string", - "nullable": true - } - } - }, - "Microsoft.OData.SampleService.Models.TripPin.PlanItem": { - "title": "PlanItem", - "type": "object", - "properties": { - "PlanItemId": { - "type": "integer", - "format": "int32" - }, - "ConfirmationCode": { - "type": "string", - "nullable": true - }, - "StartsAt": { - "type": "string", - "format": "date-time", - "example": "2017-04-13T15:51:04Z", - "nullable": true - }, - "EndsAt": { - "type": "string", - "format": "date-time", - "example": "2017-04-13T15:51:04Z", - "nullable": true - }, - "Duration": { - "type": "string", - "format": "duration", - "example": "P4DT15H51M04S", - "nullable": true - } - }, - "anyOf": [ - { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.PublicTransportation" - }, - { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Event" - }, - {} - ] - }, - "Microsoft.OData.SampleService.Models.TripPin.PlanItem-create": { - "title": "PlanItem (for create)", - "type": "object", - "properties": { - "ConfirmationCode": { - "type": "string", - "nullable": true - }, - "StartsAt": { - "type": "string", - "format": "date-time", - "example": "2017-04-13T15:51:04Z", - "nullable": true - }, - "EndsAt": { - "type": "string", - "format": "date-time", - "example": "2017-04-13T15:51:04Z", - "nullable": true - }, - "Duration": { - "type": "string", - "format": "duration", - "example": "P4DT15H51M04S", - "nullable": true - } - }, - "anyOf": [ - { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.PublicTransportation-create" - }, - { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Event-create" - }, - {} - ] - }, - "Microsoft.OData.SampleService.Models.TripPin.PlanItem-update": { - "title": "PlanItem (for update)", - "type": "object", - "properties": { - "ConfirmationCode": { - "type": "string", - "nullable": true - }, - "StartsAt": { - "type": "string", - "format": "date-time", - "example": "2017-04-13T15:51:04Z", - "nullable": true - }, - "EndsAt": { - "type": "string", - "format": "date-time", - "example": "2017-04-13T15:51:04Z", - "nullable": true - }, - "Duration": { - "type": "string", - "format": "duration", - "example": "P4DT15H51M04S", - "nullable": true - } - }, - "anyOf": [ - { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.PublicTransportation-update" - }, - { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Event-update" - }, - {} - ] - }, - "Microsoft.OData.SampleService.Models.TripPin.PublicTransportation": { - "title": "PublicTransportation", - "type": "object", - "properties": { - "PlanItemId": { - "type": "integer", - "format": "int32" - }, - "ConfirmationCode": { - "type": "string", - "nullable": true - }, - "StartsAt": { - "type": "string", - "format": "date-time", - "example": "2017-04-13T15:51:04Z", - "nullable": true - }, - "EndsAt": { - "type": "string", - "format": "date-time", - "example": "2017-04-13T15:51:04Z", - "nullable": true - }, - "Duration": { - "type": "string", - "format": "duration", - "example": "P4DT15H51M04S", - "nullable": true - }, - "SeatNumber": { - "type": "string", - "nullable": true - } - }, - "anyOf": [ - { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Flight" - }, - {} - ] - }, - "Microsoft.OData.SampleService.Models.TripPin.PublicTransportation-create": { - "title": "PublicTransportation (for create)", - "type": "object", - "properties": { - "ConfirmationCode": { - "type": "string", - "nullable": true - }, - "StartsAt": { - "type": "string", - "format": "date-time", - "example": "2017-04-13T15:51:04Z", - "nullable": true - }, - "EndsAt": { - "type": "string", - "format": "date-time", - "example": "2017-04-13T15:51:04Z", - "nullable": true - }, - "Duration": { - "type": "string", - "format": "duration", - "example": "P4DT15H51M04S", - "nullable": true - }, - "SeatNumber": { - "type": "string", - "nullable": true - } - }, - "anyOf": [ - { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Flight-create" - }, - {} - ] - }, - "Microsoft.OData.SampleService.Models.TripPin.PublicTransportation-update": { - "title": "PublicTransportation (for update)", - "type": "object", - "properties": { - "ConfirmationCode": { - "type": "string", - "nullable": true - }, - "StartsAt": { - "type": "string", - "format": "date-time", - "example": "2017-04-13T15:51:04Z", - "nullable": true - }, - "EndsAt": { - "type": "string", - "format": "date-time", - "example": "2017-04-13T15:51:04Z", - "nullable": true - }, - "Duration": { - "type": "string", - "format": "duration", - "example": "P4DT15H51M04S", - "nullable": true - }, - "SeatNumber": { - "type": "string", - "nullable": true - } - }, - "anyOf": [ - { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Flight-update" - }, - {} - ] - }, - "Microsoft.OData.SampleService.Models.TripPin.Trip": { - "title": "Trip", - "type": "object", - "properties": { - "TripId": { - "type": "integer", - "format": "int32" - }, - "ShareId": { - "type": "string", - "format": "uuid", - "example": "01234567-89ab-cdef-0123-456789abcdef", - "nullable": true - }, - "Description": { - "type": "string", - "nullable": true - }, - "Name": { - "type": "string" - }, - "Budget": { - "anyOf": [ - { - "type": "number", - "format": "float" - }, - { - "type": "string" - } - ], - "example": 3.14 - }, - "StartsAt": { - "type": "string", - "format": "date-time", - "example": "2017-04-13T15:51:04Z" - }, - "EndsAt": { - "type": "string", - "format": "date-time", - "example": "2017-04-13T15:51:04Z" - }, - "Tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "Photos": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Photo" - } - }, - "Photos@count": { - "$ref": "#/components/schemas/count" - }, - "PlanItems": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.PlanItem" - } - }, - "PlanItems@count": { - "$ref": "#/components/schemas/count" - } - } - }, - "Microsoft.OData.SampleService.Models.TripPin.Trip-create": { - "title": "Trip (for create)", - "type": "object", - "properties": { - "ShareId": { - "type": "string", - "format": "uuid", - "example": "01234567-89ab-cdef-0123-456789abcdef", - "nullable": true - }, - "Description": { - "type": "string", - "nullable": true - }, - "Name": { - "type": "string" - }, - "Budget": { - "anyOf": [ - { - "type": "number", - "format": "float" - }, - { - "type": "string" - } - ], - "example": 3.14 - }, - "StartsAt": { - "type": "string", - "format": "date-time", - "example": "2017-04-13T15:51:04Z" - }, - "EndsAt": { - "type": "string", - "format": "date-time", - "example": "2017-04-13T15:51:04Z" - }, - "Tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "PlanItems": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.PlanItem-create" - } - } - } - }, - "Microsoft.OData.SampleService.Models.TripPin.Trip-update": { - "title": "Trip (for update)", - "type": "object", - "properties": { - "ShareId": { - "type": "string", - "format": "uuid", - "example": "01234567-89ab-cdef-0123-456789abcdef", - "nullable": true - }, - "Description": { - "type": "string", - "nullable": true - }, - "Name": { - "type": "string" - }, - "Budget": { - "anyOf": [ - { - "type": "number", - "format": "float" - }, - { - "type": "string" - } - ], - "example": 3.14 - }, - "StartsAt": { - "type": "string", - "format": "date-time", - "example": "2017-04-13T15:51:04Z" - }, - "EndsAt": { - "type": "string", - "format": "date-time", - "example": "2017-04-13T15:51:04Z" - }, - "Tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "PlanItems": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.PlanItem-create" - } - } - } - }, - "geoPoint": { - "type": "object", - "properties": { - "coordinates": { - "$ref": "#/components/schemas/geoPosition" - }, - "type": { - "type": "string", - "enum": [ - "Point" - ], - "default": "Point" - } - }, - "required": [ - "type", - "coordinates" - ] - }, - "geoPosition": { - "type": "array", - "minItems": 2, - "items": { - "type": "number" - } - }, - "count": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string" - } - ], - "description": "The number of entities in the collection. Available when using the [$count](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptioncount) query option." - }, - "error": { - "type": "object", - "required": [ - "error" - ], - "properties": { - "error": { - "type": "object", - "required": [ - "code", - "message" - ], - "properties": { - "code": { - "type": "string" - }, - "message": { - "type": "string" - }, - "target": { - "type": "string" - }, - "details": { + }, + "Microsoft.OData.SampleService.Models.TripPin.Photo-create": { + "title": "Photo (for create)", + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": true + } + } + }, + "Microsoft.OData.SampleService.Models.TripPin.Photo-update": { + "title": "Photo (for update)", + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": true + } + } + }, + "Microsoft.OData.SampleService.Models.TripPin.PlanItem": { + "title": "PlanItem", + "type": "object", + "properties": { + "PlanItemId": { + "type": "integer", + "format": "int32" + }, + "ConfirmationCode": { + "type": "string", + "nullable": true + }, + "StartsAt": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z", + "nullable": true + }, + "EndsAt": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z", + "nullable": true + }, + "Duration": { + "type": "string", + "format": "duration", + "example": "P4DT15H51M04S", + "nullable": true + } + }, + "anyOf": [ + { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.PublicTransportation" + }, + { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Event" + }, + {} + ] + }, + "Microsoft.OData.SampleService.Models.TripPin.PlanItem-create": { + "title": "PlanItem (for create)", + "type": "object", + "properties": { + "ConfirmationCode": { + "type": "string", + "nullable": true + }, + "StartsAt": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z", + "nullable": true + }, + "EndsAt": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z", + "nullable": true + }, + "Duration": { + "type": "string", + "format": "duration", + "example": "P4DT15H51M04S", + "nullable": true + } + }, + "anyOf": [ + { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.PublicTransportation-create" + }, + { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Event-create" + }, + {} + ] + }, + "Microsoft.OData.SampleService.Models.TripPin.PlanItem-update": { + "title": "PlanItem (for update)", + "type": "object", + "properties": { + "ConfirmationCode": { + "type": "string", + "nullable": true + }, + "StartsAt": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z", + "nullable": true + }, + "EndsAt": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z", + "nullable": true + }, + "Duration": { + "type": "string", + "format": "duration", + "example": "P4DT15H51M04S", + "nullable": true + } + }, + "anyOf": [ + { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.PublicTransportation-update" + }, + { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Event-update" + }, + {} + ] + }, + "Microsoft.OData.SampleService.Models.TripPin.PublicTransportation": { + "title": "PublicTransportation", + "type": "object", + "properties": { + "PlanItemId": { + "type": "integer", + "format": "int32" + }, + "ConfirmationCode": { + "type": "string", + "nullable": true + }, + "StartsAt": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z", + "nullable": true + }, + "EndsAt": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z", + "nullable": true + }, + "Duration": { + "type": "string", + "format": "duration", + "example": "P4DT15H51M04S", + "nullable": true + }, + "SeatNumber": { + "type": "string", + "nullable": true + } + }, + "anyOf": [ + { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Flight" + }, + {} + ] + }, + "Microsoft.OData.SampleService.Models.TripPin.PublicTransportation-create": { + "title": "PublicTransportation (for create)", + "type": "object", + "properties": { + "ConfirmationCode": { + "type": "string", + "nullable": true + }, + "StartsAt": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z", + "nullable": true + }, + "EndsAt": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z", + "nullable": true + }, + "Duration": { + "type": "string", + "format": "duration", + "example": "P4DT15H51M04S", + "nullable": true + }, + "SeatNumber": { + "type": "string", + "nullable": true + } + }, + "anyOf": [ + { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Flight-create" + }, + {} + ] + }, + "Microsoft.OData.SampleService.Models.TripPin.PublicTransportation-update": { + "title": "PublicTransportation (for update)", + "type": "object", + "properties": { + "ConfirmationCode": { + "type": "string", + "nullable": true + }, + "StartsAt": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z", + "nullable": true + }, + "EndsAt": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z", + "nullable": true + }, + "Duration": { + "type": "string", + "format": "duration", + "example": "P4DT15H51M04S", + "nullable": true + }, + "SeatNumber": { + "type": "string", + "nullable": true + } + }, + "anyOf": [ + { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Flight-update" + }, + {} + ] + }, + "Microsoft.OData.SampleService.Models.TripPin.Trip": { + "title": "Trip", + "type": "object", + "properties": { + "TripId": { + "type": "integer", + "format": "int32" + }, + "ShareId": { + "type": "string", + "format": "uuid", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "nullable": true + }, + "Description": { + "type": "string", + "nullable": true + }, + "Name": { + "type": "string" + }, + "Budget": { + "anyOf": [ + { + "type": "number", + "format": "float" + }, + { + "type": "string" + } + ], + "example": 3.14 + }, + "StartsAt": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z" + }, + "EndsAt": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z" + }, + "Tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "Photos": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.Photo" + } + }, + "Photos@odata.count": { + "$ref": "#/components/schemas/count" + }, + "PlanItems": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.PlanItem" + } + }, + "PlanItems@odata.count": { + "$ref": "#/components/schemas/count" + } + } + }, + "Microsoft.OData.SampleService.Models.TripPin.Trip-create": { + "title": "Trip (for create)", + "type": "object", + "properties": { + "ShareId": { + "type": "string", + "format": "uuid", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "nullable": true + }, + "Description": { + "type": "string", + "nullable": true + }, + "Name": { + "type": "string" + }, + "Budget": { + "anyOf": [ + { + "type": "number", + "format": "float" + }, + { + "type": "string" + } + ], + "example": 3.14 + }, + "StartsAt": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z" + }, + "EndsAt": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z" + }, + "Tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "PlanItems": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.PlanItem-create" + } + } + } + }, + "Microsoft.OData.SampleService.Models.TripPin.Trip-update": { + "title": "Trip (for update)", + "type": "object", + "properties": { + "ShareId": { + "type": "string", + "format": "uuid", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "nullable": true + }, + "Description": { + "type": "string", + "nullable": true + }, + "Name": { + "type": "string" + }, + "Budget": { + "anyOf": [ + { + "type": "number", + "format": "float" + }, + { + "type": "string" + } + ], + "example": 3.14 + }, + "StartsAt": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z" + }, + "EndsAt": { + "type": "string", + "format": "date-time", + "example": "2017-04-13T15:51:04Z" + }, + "Tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "PlanItems": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Microsoft.OData.SampleService.Models.TripPin.PlanItem-create" + } + } + } + }, + "geoPoint": { + "type": "object", + "properties": { + "coordinates": { + "$ref": "#/components/schemas/geoPosition" + }, + "type": { + "type": "string", + "enum": [ + "Point" + ], + "default": "Point" + } + }, + "required": [ + "type", + "coordinates" + ] + }, + "geoPosition": { "type": "array", + "minItems": 2, "items": { - "type": "object", - "required": [ - "code", - "message" - ], - "properties": { - "code": { - "type": "string" - }, - "message": { - "type": "string" - }, - "target": { - "type": "string" - } - } + "type": "number" } - }, - "innererror": { + }, + "count": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "The number of entities in the collection. Available when using the [$count](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptioncount) query option." + }, + "error": { "type": "object", - "description": "The structure of this object is service-specific" - } + "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" + "parameters": { + "top": { + "name": "$top", + "in": "query", + "description": "Show only the first n items, see [Paging - Top](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptiontop)", + "schema": { + "type": "integer", + "minimum": 0 + }, + "example": 50 + }, + "skip": { + "name": "$skip", + "in": "query", + "description": "Skip the first n items, see [Paging - Skip](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionskip)", + "schema": { + "type": "integer", + "minimum": 0 + } + }, + "count": { + "name": "$count", + "in": "query", + "description": "Include count of items, see [Count](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptioncount)", + "schema": { + "type": "boolean" + } + }, + "search": { + "name": "$search", + "in": "query", + "description": "Search items by search phrases, see [Searching](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionsearch)", + "schema": { + "type": "string" + } + } + }, + "responses": { + "error": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error" + } + } + } } - } } - } } - } -} +} \ No newline at end of file diff --git a/test/lib/compile/data/authorization.openapi3.json b/test/lib/compile/data/authorization.openapi3.json index d5141f4..7458751 100644 --- a/test/lib/compile/data/authorization.openapi3.json +++ b/test/lib/compile/data/authorization.openapi3.json @@ -1,515 +1,515 @@ { - "openapi": "3.0.2", - "info": { - "title": "Service for namespace auth.example", - "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/[Person{bg:lightslategray}],[People%20{bg:lawngreen}]++-*>[Person])\n\n### Legend\n![Legend](https://yuml.me/diagram/plain;dir:TB;scale:60/class/[External.Type{bg:whitesmoke}],[ComplexType],[EntityType{bg:lightslategray}],[EntitySet/Singleton/Operation{bg:lawngreen}])", - "version": "" - }, - "x-sap-api-type": "ODATAV4", - "x-odata-version": "4.01", - "x-sap-shortText": "Service for namespace auth.example", - "servers": [ - { - "url": "https://localhost/service-root" - } - ], - "tags": [ - { - "name": "People" - } - ], - "paths": { - "/$batch": { - "post": { - "summary": "Sends a group of requests", - "description": "Group multiple requests into a single request payload, see [Batch Requests](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_BatchRequests).\n\n*Please note that \"Try it out\" is not supported for this request.*", - "tags": [ - "Batch Requests" - ], - "requestBody": { - "required": true, - "description": "Batch request", - "content": { - "multipart/mixed;boundary=request-separator": { - "schema": { - "type": "string" - }, - "example": "--request-separator\nContent-Type: application/http\nContent-Transfer-Encoding: binary\n\nGET People HTTP/1.1\nAccept: application/json\n\n\n--request-separator--" + "openapi": "3.0.2", + "info": { + "title": "Service for namespace auth.example", + "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/[Person{bg:lightslategray}],[People%20{bg:lawngreen}]++-*>[Person])\n\n### Legend\n![Legend](https://yuml.me/diagram/plain;dir:TB;scale:60/class/[External.Type{bg:whitesmoke}],[ComplexType],[EntityType{bg:lightslategray}],[EntitySet/Singleton/Operation{bg:lawngreen}])", + "version": "" + }, + "x-sap-api-type": "ODATAV4", + "x-odata-version": "4.0", + "x-sap-shortText": "Service for namespace auth.example", + "servers": [ + { + "url": "https://localhost/service-root" + } + ], + "tags": [ + { + "name": "People" + } + ], + "paths": { + "/$batch": { + "post": { + "summary": "Sends a group of requests", + "description": "Group multiple requests into a single request payload, see [Batch Requests](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_BatchRequests).\n\n*Please note that \"Try it out\" is not supported for this request.*", + "tags": [ + "Batch Requests" + ], + "requestBody": { + "required": true, + "description": "Batch request", + "content": { + "multipart/mixed;boundary=request-separator": { + "schema": { + "type": "string" + }, + "example": "--request-separator\nContent-Type: application/http\nContent-Transfer-Encoding: binary\n\nGET People 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" + } + } } - } }, - "responses": { - "200": { - "description": "Batch response", - "content": { - "multipart/mixed": { - "schema": { - "type": "string" + "/People": { + "get": { + "summary": "Retrieves a list of people.", + "tags": [ + "People" + ], + "parameters": [ + { + "$ref": "#/components/parameters/top" + }, + { + "$ref": "#/components/parameters/skip" + }, + { + "$ref": "#/components/parameters/search" + }, + { + "name": "$filter", + "description": "Filter items by property values, see [Filtering](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionfilter)", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/count" + }, + { + "name": "$orderby", + "description": "Order items by property values, see [Sorting](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionorderby)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "ID desc", + "Name", + "Name desc" + ] + } + } + }, + { + "name": "$select", + "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Name" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved people", + "content": { + "application/json": { + "schema": { + "type": "object", + "title": "Collection of Person", + "properties": { + "@odata.count": { + "$ref": "#/components/schemas/count" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/auth.example.Person" + } + } + } + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "post": { + "summary": "Creates a single person.", + "tags": [ + "People" + ], + "requestBody": { + "description": "New person", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/auth.example.Person-create" + } + } + } }, - "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" - } - } - } - }, - "/People": { - "get": { - "summary": "Retrieves a list of people.", - "tags": [ - "People" - ], - "parameters": [ - { - "$ref": "#/components/parameters/top" - }, - { - "$ref": "#/components/parameters/skip" - }, - { - "$ref": "#/components/parameters/search" - }, - { - "name": "$filter", - "description": "Filter items by property values, see [Filtering](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionfilter)", - "in": "query", - "schema": { - "type": "string" - } - }, - { - "$ref": "#/components/parameters/count" - }, - { - "name": "$orderby", - "description": "Order items by property values, see [Sorting](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionorderby)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "ID", - "ID desc", - "Name", - "Name desc" - ] - } - } - }, - { - "name": "$select", - "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "ID", - "Name" - ] - } - } - } - ], - "responses": { - "200": { - "description": "Retrieved people", - "content": { - "application/json": { - "schema": { - "type": "object", - "title": "Collection of Person", - "properties": { - "@count": { - "$ref": "#/components/schemas/count" + "responses": { + "201": { + "description": "Created person", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/auth.example.Person" + } + } + } }, - "value": { - "type": "array", - "items": { - "$ref": "#/components/schemas/auth.example.Person" - } + "4XX": { + "$ref": "#/components/responses/error" } - } } - } } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - }, - "post": { - "summary": "Creates a single person.", - "tags": [ - "People" - ], - "requestBody": { - "description": "New person", - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/auth.example.Person-create" - } - } - } }, - "responses": { - "201": { - "description": "Created person", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/auth.example.Person" + "/People('{ID}')": { + "parameters": [ + { + "description": "key: ID", + "in": "path", + "name": "ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "get": { + "summary": "Retrieves a single person.", + "tags": [ + "People" + ], + "parameters": [ + { + "name": "$select", + "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", + "in": "query", + "explode": false, + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "ID", + "Name" + ] + } + } + } + ], + "responses": { + "200": { + "description": "Retrieved person", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/auth.example.Person" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "patch": { + "summary": "Changes a single person.", + "tags": [ + "People" + ], + "requestBody": { + "description": "New property values", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/auth.example.Person-update" + } + } + } + }, + "responses": { + "204": { + "description": "Success" + }, + "4XX": { + "$ref": "#/components/responses/error" + } + } + }, + "delete": { + "summary": "Deletes a single person.", + "tags": [ + "People" + ], + "responses": { + "204": { + "description": "Success" + }, + "4XX": { + "$ref": "#/components/responses/error" + } } - } } - }, - "4XX": { - "$ref": "#/components/responses/error" - } } - } }, - "/People('{ID}')": { - "parameters": [ - { - "description": "key: ID", - "in": "path", - "name": "ID", - "required": true, - "schema": { - "type": "string" - } - } - ], - "get": { - "summary": "Retrieves a single person.", - "tags": [ - "People" - ], - "parameters": [ - { - "name": "$select", - "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)", - "in": "query", - "explode": false, - "schema": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "ID", - "Name" + "components": { + "schemas": { + "auth.example.Person": { + "title": "Person", + "type": "object", + "properties": { + "ID": { + "type": "string" + }, + "Name": { + "type": "string", + "nullable": true + } + } + }, + "auth.example.Person-create": { + "title": "Person (for create)", + "type": "object", + "properties": { + "ID": { + "type": "string" + }, + "Name": { + "type": "string", + "nullable": true + } + }, + "required": [ + "ID" ] - } + }, + "auth.example.Person-update": { + "title": "Person (for update)", + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": true + } + } + }, + "count": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "The number of entities in the collection. Available when using the [$count](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptioncount) query option." + }, + "error": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "target": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "target": { + "type": "string" + } + } + } + }, + "innererror": { + "type": "object", + "description": "The structure of this object is service-specific" + } + } + } + } } - } - ], - "responses": { - "200": { - "description": "Retrieved person", - "content": { - "application/json": { + }, + "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": { - "$ref": "#/components/schemas/auth.example.Person" + "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" } - } - } - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - }, - "patch": { - "summary": "Changes a single person.", - "tags": [ - "People" - ], - "requestBody": { - "description": "New property values", - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/auth.example.Person-update" - } } - } }, "responses": { - "204": { - "description": "Success" - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - }, - "delete": { - "summary": "Deletes a single person.", - "tags": [ - "People" - ], - "responses": { - "204": { - "description": "Success" - }, - "4XX": { - "$ref": "#/components/responses/error" - } - } - } - } - }, - "components": { - "schemas": { - "auth.example.Person": { - "title": "Person", - "type": "object", - "properties": { - "ID": { - "type": "string" - }, - "Name": { - "type": "string", - "nullable": true - } - } - }, - "auth.example.Person-create": { - "title": "Person (for create)", - "type": "object", - "properties": { - "ID": { - "type": "string" - }, - "Name": { - "type": "string", - "nullable": true - } - }, - "required": [ - "ID" - ] - }, - "auth.example.Person-update": { - "title": "Person (for update)", - "type": "object", - "properties": { - "Name": { - "type": "string", - "nullable": true - } - } - }, - "count": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string" - } - ], - "description": "The number of entities in the collection. Available when using the [$count](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptioncount) query option." - }, - "error": { - "type": "object", - "required": [ - "error" - ], - "properties": { - "error": { - "type": "object", - "required": [ - "code", - "message" - ], - "properties": { - "code": { - "type": "string" - }, - "message": { - "type": "string" - }, - "target": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "required": [ - "code", - "message" - ], - "properties": { - "code": { - "type": "string" - }, - "message": { - "type": "string" - }, - "target": { - "type": "string" + "error": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error" + } } - } } - }, - "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" + "securitySchemes": { + "api_key": { + "description": "Authentication via API key", + "type": "apiKey", + "name": "x-api-key", + "in": "header" + }, + "http_bearer": { + "description": "HTTP authentication with bearer token", + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT" + }, + "oauth_authcode": { + "description": "Authentication via OAuth2 with authorization code flow", + "type": "oauth2", + "flows": { + "authorizationCode": { + "authorizationUrl": "https://example.com/api/oauth/dialog", + "tokenUrl": "https://example.com/api/oauth/token", + "refreshUrl": "https://example.com/api/oauth/refresh", + "scopes": { + "do:something": "do something" + } + } + } + }, + "oauth_clientcredentials": { + "description": "Authentication via OAuth2 with client credentials flow", + "type": "oauth2", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/token", + "refreshUrl": "https://example.com/api/oauth/refresh", + "scopes": { + "do:something": "do something" + } + } + } + }, + "oauth_implicit": { + "description": "Authentication via OAuth2 with implicit flow", + "type": "oauth2", + "flows": { + "implicit": { + "authorizationUrl": "https://example.com/api/oauth/dialog", + "refreshUrl": "https://example.com/api/oauth/refresh", + "scopes": { + "write:foo": "modify foo", + "read:foo": "read foo" + } + } + } + }, + "oauth_password": { + "description": "Authentication via OAuth2 with resource owner password flow", + "type": "oauth2", + "flows": { + "password": { + "tokenUrl": "https://example.com/api/oauth/token", + "refreshUrl": "https://example.com/api/oauth/refresh", + "scopes": { + "do:something": "do something" + } + } + } + }, + "open_id": { + "description": "Authentication via OpenID Connect", + "type": "openIdConnect", + "openIdConnectUrl": "https://example.com/openid/issuer/location" } - } } - } }, - "securitySchemes": { - "api_key": { - "description": "Authentication via API key", - "type": "apiKey", - "name": "x-api-key", - "in": "header" - }, - "http_bearer": { - "description": "HTTP authentication with bearer token", - "type": "http", - "scheme": "bearer", - "bearerFormat": "JWT" - }, - "oauth_authcode": { - "description": "Authentication via OAuth2 with authorization code flow", - "type": "oauth2", - "flows": { - "authorizationCode": { - "authorizationUrl": "https://example.com/api/oauth/dialog", - "tokenUrl": "https://example.com/api/oauth/token", - "refreshUrl": "https://example.com/api/oauth/refresh", - "scopes": { - "do:something": "do something" - } - } - } - }, - "oauth_clientcredentials": { - "description": "Authentication via OAuth2 with client credentials flow", - "type": "oauth2", - "flows": { - "clientCredentials": { - "tokenUrl": "https://example.com/api/oauth/token", - "refreshUrl": "https://example.com/api/oauth/refresh", - "scopes": { - "do:something": "do something" - } - } - } - }, - "oauth_implicit": { - "description": "Authentication via OAuth2 with implicit flow", - "type": "oauth2", - "flows": { - "implicit": { - "authorizationUrl": "https://example.com/api/oauth/dialog", - "refreshUrl": "https://example.com/api/oauth/refresh", - "scopes": { - "write:foo": "modify foo", - "read:foo": "read foo" - } - } - } - }, - "oauth_password": { - "description": "Authentication via OAuth2 with resource owner password flow", - "type": "oauth2", - "flows": { - "password": { - "tokenUrl": "https://example.com/api/oauth/token", - "refreshUrl": "https://example.com/api/oauth/refresh", - "scopes": { - "do:something": "do something" - } - } + "security": [ + { + "api_key": [] + }, + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] } - }, - "open_id": { - "description": "Authentication via OpenID Connect", - "type": "openIdConnect", - "openIdConnectUrl": "https://example.com/openid/issuer/location" - } - } - }, - "security": [ - { - "api_key": [] - }, - { - "petstore_auth": [ - "write:pets", - "read:pets" - ] - } - ] -} + ] +} \ No newline at end of file diff --git a/test/lib/compile/openapi.test.js b/test/lib/compile/openapi.test.js index 79e5374..fc34fc5 100644 --- a/test/lib/compile/openapi.test.js +++ b/test/lib/compile/openapi.test.js @@ -695,7 +695,8 @@ service CatalogService { } `); const openAPI = toOpenApi(csn); - const params = openAPI.paths['/getMapping'].get.parameters; + const pathKey = Object.keys(openAPI.paths).find(p => p.includes('getMapping')); + const params = openAPI.paths[pathKey].get.parameters; assert.strictEqual(params.length, 2); assert.strictEqual(params[0].name, 'paramA'); assert.strictEqual(params[0].required, true);