
{
    "openapi": "3.0.1",
    "info": {
        "title": "EDI OData API",
        "version": "1.0"
    },
    "servers": [
        {
            "url": "https://api.us.dev.3E.thomsonreuters.com/edi"
        }
    ],
    "paths": {
        "/api/odata/{entity}": {
            "get": {
                "tags": [
                    "OData.Entities"
                ],
                "summary": "Get entities from the database table",
                "description": "Get entities from the database table",
                "operationId": "OData-Entities",
                "parameters": [
                    {
                        "name": "entity",
                        "in": "path",
                        "description": "Name of the database table which contains requested entities.",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "$top",
                        "in": "query",
                        "description": "Show only the first n items, see [OData Paging – Top](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptiontop))",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "$skip",
                        "in": "query",
                        "description": "Skip the first n items, see [OData Paging - Skip](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionskip)",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "$filter",
                        "in": "query",
                        "description": "Filter items by property values, see [OData Filtering](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionfilter)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "$count",
                        "in": "query",
                        "description": "Include count of items, see [OData Count](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptioncount)",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "$select",
                        "in": "query",
                        "description": "Select entity properties to be returned",
                        "schema": {
                            "type": "array"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Retrieved entities",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiOdata-entity-Get200ApplicationJsonResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authorization information is missing or invalid."
                    }
                }
            }
        },
        "/api/odata/{entity}({id})": {
            "get": {
                "tags": [
                    "OData.Entity"
                ],
                "summary": "Get entity from the database table by key",
                "description": "Get entity from the database table by key",
                "operationId": "OData-Entity",
                "parameters": [
                    {
                        "name": "entity",
                        "in": "path",
                        "description": "Name of the database table which contains requested entity.",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Id of entity",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "$select",
                        "in": "query",
                        "description": "Select entity properties to be returned",
                        "schema": {
                            "type": "array"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Retrieved entity",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiOdata-entity-id-Get200ApplicationJsonResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authorization information is missing or invalid."
                    }
                }
            }
        },
        "/api/odata": {
            "get": {
                "tags": [
                    "OData.Metadata"
                ],
                "summary": "Get metadata for database tables",
                "description": "Get metadata for database tables",
                "operationId": "OData-Metadata",
                "responses": {
                    "200": {
                        "description": "Retrieved metadata",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiOdataGet200ApplicationJsonResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authorization information is missing or invalid."
                    }
                }
            }
        }       
    },
    "components": {
	  "securitySchemes": {
        "oAuth2ClientCredentials": {
          "type": "oauth2",
          "description": "Client creds",
          "flows": { 
            "clientCredentials": {
              "tokenUrl": "https://auth-nonprod.thomsonreuters.com/oauth/token",
              "scopes": {}
			}
		  }
		}  
	  },
        "schemas": {
            "ApiOdataGet200ApplicationJsonResponse": {
                "title": "Collection of metadata entities",
                "type": "object",
                "properties": {
                    "value": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        }
                    }
                }
            },
            "ApiOdata-entity-Get200ApplicationJsonResponse": {
                "title": "Collection of entities",
                "type": "object",
                "properties": {
                    "value": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        }
                    }
                }
            },
            "ApiOdata-entity-id-Get200ApplicationJsonResponse": {
                "title": "Collection which contains returned entity",
                "type": "object",
                "properties": {
                    "value": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        }
                    }
                }
            },
            "ApiConfigGet200ApplicationJsonResponse": {
                "type": "object"
            },
            "ApiConfigPutRequest": {
                "type": "object"
            }
        }
    },
	"security": {
     "oAuth2ClientCredentials": []
    }
}
